Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

How to enable XML Script in a Web Forms application

$
0
0

For those of you interested in taking a journey back to the future, here is how you can enable theXML Script declarative language in a modern ASP.NET web application project.

My working setup is Windows 10, Visual Studio Community 2017 and the project is a ASP.NET Application (.NET Framework) using the defaultWeb Forms project template.

To have the browser understand the xml-script type you have to reference thePreviewScript.js file in the ScriptManager control. This file is embedded as a web resource in theMicrosoft.Web.Preview assembly. Interestingly enough, the assembly can still be downloaded officially from Microsoft as part of the Microsoft ASP.NET Futures (May 2007) package. In turn, this package requires ASP.NET AJAX Extensions 1.0 which is available from Microsoft, too.

After having installed ASP.NET AJAX Extensions 1.0 and ASP.NET Futures (in that order) add a reference toMicrosoft.Web.Preview in your project (right click References -> Add reference -> Assemblies -> search for Microsoft.Web.Preview and check it). 

Then, in your master page you can add the following reference in the ScriptManager control:

<asp:ScriptManager runat="server"><Scripts><%--Site Scripts--%><asp:ScriptReference Name="PreviewScript.js" Assembly="Microsoft.Web.Preview" /></Scripts></asp:ScriptManager>

And then in your content web page you can use xml-script declarations, for example:

<script type="text/xml-script"><page xmlns="http://schemas.microsoft.com/xml-script/2005"><components><application load="page_load" /></components></page></script>

And that was it! Have fun.


freetextbox is postback or refreshed with asp.net timer

$
0
0

have wrapped up the freetextbox editor inside updatepanel but it still keep refreshing maybe caused by timer tick,

tried enablepartialrendering="true" inside script manager wont make difference

<asp:Timer ID="FieldTimer2" runat="server" Interval="1000" OnTick="FieldTimer2_Tick" /></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="FieldTimer2" EventName="Tick" /></Triggers></asp:UpdatePanel>
...<asp:UpdatePanel ID="udpfreetextbox" runat="server"><ContentTemplate><FTB:FreeTextBox id="FreeTextBox1" runat="Server"  /></ContentTemplate></asp:UpdatePanel>

Ajax Tab overflow content not getting printed

$
0
0
Hi all,
I am using below code from one of the threads. This works fine for me except that in one of the tabs there are textboxes outside the visible page area and are reachable via horizontal scrollbars. I have tried to print the overflow content by following modifications however it is not working:
temp.find(".ajax__tab_panel").css("display", "block").css("visibility", "visible").css("width", "auto").css("height", "auto").css("overflow", "visible !important");
Kindly help.
Regards,
Raj.


<script
src="http://code.jquery.com/jquery-1.9.1.js"></script><script>$(function(){//print when click the button.. $("#Button1").click(function(){var temp =$("div").html($(".ajax__tab_body").html()); temp.find(".ajax__tab_panel").css("display","block").css("visibility","visible");PrintElem(temp);});})</script><scripttype="text/javascript">functionPrintElem(elem){Popup($(elem).html());}functionPopup(data){var mywindow = window.open('','my div','height=400,width=600'); mywindow.document.write('<html><head><title>my div</title>');/*optional stylesheet*///mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />'); mywindow.document.write('</head><body >'); mywindow.document.write(data); mywindow.document.write('</body></html>'); mywindow.print(); mywindow.close();returntrue;}</script><inputid="Button1"type="button"value="Print"/><asp:TabContainerID="TabContainer1"runat="server"Width="200px"><asp:TabPanelrunat="server"ID="Panel1"><HeaderTemplate>Panel1</HeaderTemplate><ContentTemplate> I'm panel 1</ContentTemplate></asp:TabPanel><asp:TabPanelrunat="server"ID="Panel2"><HeaderTemplate>Panel2</HeaderTemplate><ContentTemplate> I'm panel 2</ContentTemplate></asp:TabPanel><asp:TabPanelrunat="server"ID="Panel3"><HeaderTemplate>Panel3</HeaderTemplate><ContentTemplate> I'm panel 3</ContentTemplate></asp:TabPanel><asp:TabPanelrunat="server"ID="Panel4"><HeaderTemplate>Panel4</HeaderTemplate><ContentTemplate> I'm panel 5</ContentTemplate></asp:TabPanel><asp:TabPanelrunat="server"ID="Panel5"><HeaderTemplate>Panel5</HeaderTemplate><ContentTemplate> I'm panel 5</ContentTemplate></asp:TabPanel><asp:TabPanelrunat="server"ID="Panel6"><HeaderTemplate>Panel6</HeaderTemplate><ContentTemplate> I'm panel 6</ContentTemplate></asp:TabPanel></asp:TabContainer>

Control like Netflix

Display alert

$
0
0

I am trying to display alert message depending on recCnt value as below:

ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "alertMsg", "SaveAlert('" + recCnt + "')", true);

JS:

function SaveAlert(rst) {
if (rst == '-1')
alert('Selected Item already there in your Favorite list');
else if (rst == '-2')
alert('Selected Item already there in your Blocked list');
else
alert('Record Saved Successfully');
}

Though it's displaying message fine but sometimes it displays message and sometimes not. Moreover, it completely blackens background. What can be the best way to display alert? 

Package updates from nuget returns build errors for Microsoft ENVDTE, ENVDTE80 paths

$
0
0

Hi,

I am trying to migrate a project to Framework 4.7.2, When I update my packages using nuget package manager, I get the build errors:

Interop type WindowKinds cannot be embedded. use the applicable interface instead.

Interop type constants cannot be embedded. Use the applicable interface instead.

The lines of code which returns the error is:

application.Windows.Item(EnvDTE80.WindowKinds.vsWindowKindErrorList).Activate();

 application.Windows.Item(EnvDTE.Constants.vsWindowKindOutput).Activate();

My idea is to build the solution without any errors and the solution will be updated to Framework 4.7.2. I would appreciate an optimal solution to migrate a solution as well if there is any. Please let me know.

Luc

get file name and path from dropzone

$
0
0

Hi,

I have a dropzone where I'm supposed to drop an image. The Image should be uploaded only if the user presses some other Submit button. I  have js:

var myDropzoneMeta = new Dropzone("#metaImage",
        {
            url: "/file/post",
            autoProcessQueue: false,
            autoDiscover: false,
            maxFiles: 1,
            addRemoveLinks: true,
            init: function () {
                this.on("maxfilesexceeded", function (file) {
                    this.removeAllFiles();
                    this.addFile(file);
                });
                this.on("thumbnail", function (file) {
                    //here is the problem  I need to get the file name and file path and put it in something
                });
            }
        });$("#metaImage").addClass('dropzone');

Then I have in my view 

<label for="metaImage" class="col-form-label">Meta Image</label><div id="metaImage"><div class="dz-message" data-dz-message><span>Drop Image Here</span></div></div>

and the script to handle the post

$.post("/umbraco/DealManager/Deal/SaveDeal",
        {
            'Id': @deal.Id,
            'MetaImage'://here I'm supposed to send the image file name and path

         })

Problem is how do I get the file name and file path from the dropzone?

Please help

Passing Textbox Value to ContextKey in AutoCompleteExtender

$
0
0

Hello,

I'm trying to use the contextKey in the AJAX AutoComplete tool but there is a problem with regards to passing the contextKey value to the method located in the web service file.

Let me describe how my web form is organised.

There are two textboxes. One of them has the AutoComplete tool. The user enters a word in Textbox1 (which does not have the AutoComplete tool). Afterwards, when he clicks in TextBox2 (which has the AutoComplete tool) and starts to type, the AutoComplete tool will show him the close matches. Now, the items in the AutoComplete menu are retrieved from a SQL database. The Select command (of the AutoComplete which is in the web service file) returns values based on the the value of TextBox1 in the main forum.

This is the client-code of AutoComplete 1:

<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
TargetControlID="TextBox2"
ServicePath="AutoCompleteField.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="1"
CompletionInterval="1"
UseContextKey="true"
ContextKey=***WHAT SHOULD I WRITE HERE? SOMETHING LIKE TextBox1.Text***></cc1:AutoCompleteExtender>

Thanks in advance.

modalPopupExtender is not modal

$
0
0

 I have created a popup using Ajax ((ver 19.1.0.0) modalPopupExtender in a form in a c# aspx project in VS 2013 with the following parameters in the form.aspx viewed as markup:

%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

.modalBackground
        {
            background-color:Gray;
            filter:alpha(opacity=70);
            opacity:0.7;
        }
    .modalPopup  
        {  
            background-color: #FFFFFF;  
            border-width: 3px;  
            border-style: none;  
            border-color: black;  
            padding-top: 0px;  
            padding-left: 0px;  
            width: 350px;  
            height: 150px;  
        } 
		

<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="cmdTest"  
    CancelControlID="Button2" BackgroundCssClass="modalBackground">  </cc1:ModalPopupExtender><asp:Panel ID="Panl1" runat="server" CssClass="modalPopup" align="center" style = "display:none">  <iframe style=" width: 350px; height: 150px; background-color:white;" id="irm1" src="NoLicense.aspx" runat="server" ></iframe>  <br/>  <asp:Button ID="Button2" runat="server" Text="Close" />  </asp:Panel>  

The popup form is NoLicense.aspx. The popup appears OK when called from code via mp1.show() but execution continues - the popup form is not modal. How can I make it modal?

Query is not giving correct output of Column (Small_Bale_Weight)

$
0
0

sql query is not giving proper result of Column (Small_Bale_Weight)

here is my complete data and query 

CREATE TABLE #Catagory (CID INT,CName VARCHAR(50))
CREATE TABLE #Sections (SecID INT,Secnam VARCHAR(50))
CREATE TABLE #ItemMasterFile(CodeItem INT,Descriptionitem VARCHAR(50),SecID INT,CID INT,weight int)
CREATE TABLE #Bigbalprd(BID INT,CodeItem INT,SecID INT,CID INT,Bpqty INT,Entrydate DATETIME , DelID int,Bweight int)
CREATE TABLE #Probale(BID INT,CodeItem INT,prdQTY INT,weight int,Entrydate DATETIME,DelID int)
CREATE TABLE #Emp_Strength(EID INT,SecID INT,QTY int, Entrydate DATETIME)

INSERT INTO #Catagory VALUES(1,'INDIA')
INSERT INTO #Catagory VALUES(2,'INDIA(Cut)')
INSERT INTO #Catagory VALUES(3,'Pakistan')
INSERT INTO #Catagory VALUES(4,'Pakistan(Cut)')


INSERT INTO #Sections VALUES(1,'HR')
INSERT INTO #Sections VALUES(2,'Baby')
INSERT INTO #Sections VALUES(3,'Ladies')
INSERT INTO #Sections VALUES(4,'Mix Rammage')

INSERT INTO #ItemMasterFile VALUES(1,'A',1,1,100)
INSERT INTO #ItemMasterFile VALUES(2,'B',2,2,100)
INSERT INTO #ItemMasterFile VALUES(3,'C',3,3,100)
INSERT INTO #ItemMasterFile VALUES(4,'D',4,null,100)
INSERT INTO #ItemMasterFile VALUES(5,'e',5,null,100)
INSERT INTO #ItemMasterFile VALUES(6,'f',6,null,100)
INSERT INTO #ItemMasterFile VALUES(7,'g',4,2,100)
INSERT INTO #ItemMasterFile VALUES(8,'h',4,3,100)
INSERT INTO #ItemMasterFile VALUES(9,'K',2,2,100)
INSERT INTO #ItemMasterFile VALUES(10,'L',4,3,100)
INSERT INTO #ItemMasterFile VALUES(11,'M',2,4,100)

INSERT INTO #Bigbalprd VALUES(1,1,1,1,1,'01-06-2019',null,100)
INSERT INTO #Bigbalprd VALUES(2,3,3,3,1,'02-06-2019',null,100)
INSERT INTO #Bigbalprd VALUES(3,4,null,4,1,'03-06-2019',null,100)
INSERT INTO #Bigbalprd VALUES(4,4,null,4,1,'04-06-2019',null,100)
INSERT INTO #Bigbalprd VALUES(4,5,null,4,1,'04-06-2019',null,100)

INSERT INTO #Probale VALUES(1,1,1,100,'01-06-2019',null)
INSERT INTO #Probale VALUES(2,3,1,200,'02-06-2019',null)
INSERT INTO #Probale VALUES(3,11,1,200,'03-06-2019',null)
INSERT INTO #Probale VALUES(4,10,1,200,'08-06-2019',null)
INSERT INTO #Probale VALUES(3,8,1,200,'03-06-2019',null)
INSERT INTO #Probale VALUES(4,9,1,200,'08-06-2019',null)
INSERT INTO #Probale VALUES(4,9,1,200,'08-06-2019',null)

INSERT INTO #Emp_Strength VALUES(1,1,4,'01-05-2019')
INSERT INTO #Emp_Strength VALUES(2,3,5,'02-05-2019')
INSERT INTO #Emp_Strength VALUES(3,3,3,'03-05-2019')
INSERT INTO #Emp_Strength VALUES(4,4,7,'04-05-2019')

DECLARE @StartDate DATETIME, @Enddate DATETIME
SET @StartDate = '01-06-2019'
SET @Enddate = '09-06-2019'

;WITH emp

as
(
select Secnam,ISNULL(sum(e.qty),0) Employee_QTY from #Sections s
left join #Emp_Strength e on s.secid=e.secid
where (Entrydate BETWEEN @StartDate AND @Enddate or Entrydate is null)
group by Secnam
),cte
AS
(
SELECT DISTINCT Sec.Secnam,
ISNULL(SUM(b1.Bpqty),0)Bigbale_QTY,ISNULL(sum(b1.Bweight),0)Bigbale_Weight,
ISNULL(SUM(b.prdQTY),0)Smallbale_QTY,ISNULL(SUM(i.weight),0)Small_Bale_weight
--ISNULL(SUM(emp.QTY),0)Employee_QTY
FROM #ItemMasterFile i
LEFT OUTER JOIN #Probale b ON i.CodeItem = b.CodeItem
LEFT OUTER JOIN #Bigbalprd b1 ON i.CodeItem = b1.CodeItem
Full Outer Join #Sections sec on i.SecID=sec.SecID
--left join Emp_Strength emp on emp.SecID = sec.SecID
--FULL OUTER JOIN Sections s ON i.SecID = s.SecID
where (b.DelID is null and b.Entrydate BETWEEN @StartDate AND @Enddate or b.EntryDate is null )
and
(b1.DelID is null and b1.EntryDate BETWEEN @StartDate AND @Enddate or b1.EntryDate is Null )


GROUP BY sec.Secnam
) SELECT cte.secnam, Smallbale_QTY,Small_Bale_weight, Bigbale_QTY, Bigbale_Weight,
( SELECT SUM(val)
FROM (VALUES (Bigbale_QTY)
, (Smallbale_QTY)

) AS value(val)
) AS Total_QTY,
( SELECT SUM(val)
FROM (VALUES (Bigbale_Weight),
(Small_Bale_weight )
)AS value(val)
) AS Total_Weight ,coalesce(Employee_QTY,0) Employee_QTY
FROM cte left join emp on cte.secnam=emp.secnam

HERE IS MY OUTPUT IN WHICH COLUMN OF SMALL BALE WEIGHT  RESULT IS NOT COMING CORRECT..

HERE IS LINK OF MY RESULT IMAGE   (https://ibb.co/TBXFzyq)

Image

Refreshing Google map under Update Panel by using Timer control

$
0
0

I have a google map on web page which I wish to refresh after every certain time of period.

In order to do that I kept google map under the UpdatePanel and place a timer control outside the update panel, set the interval 5000 mili seconds. On the Tick event of timer control I called the method which is collecting the coordinates and put on the google map and suppose it should work but it is not working.

The page refresh but the map area goes out after first refresh and never get back.

Can anyone help?

<asp:Timer ID="mapTimer" runat="server" Interval="5000"></asp:Timer><asp:UpdatePanel ID="mapPanel" runat="server" updatemode="Always" ><ContentTemplate><div id="map"></div><script>

    var map, infoWindow;
    var startLocation_lat, startLocation_lng;
    //var mapTimer = setInterval(initialize, 32000);      // Auto refresh the google map every after 10 seconds

    function initialize() {

        var coordinates = {<%=Coordinates%>};

        // Picking up the first location latitude and longitude to keep the location in center of the map

        for (var ab in coordinates) {
            for (cd = 0; cd < coordinates[ab].length; cd++) {
                if (cd == coordinates[ab].length - 1) {
                    startLocation_lat = coordinates[ab][cd][1];
                    startLocation_lng = coordinates[ab][cd][2];
                }
            }
        }

        var mapOptions = {
            zoom: <%=MapZoomValue%>,
            center: new google.maps.LatLng(startLocation_lat, startLocation_lng),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };

        var bounds = new google.maps.LatLngBounds();
        var map = new google.maps.Map(document.getElementById("map"), mapOptions);

        var myarr = [];
        for (var i in coordinates) {
            for (j = 0; j < coordinates[i].length; j++) {
                myarr.push(new google.maps.LatLng(coordinates[i][j][1], coordinates[i][j][2]));
            }

            var mypath = new google.maps.Polyline({
                path: myarr,
                strokeColor: '#FF0000',
                strokeOpacity: 0.5,
                strokeWeight: 6,
                fillColor: '#FF0000',
                fillOpacity: 0.35
            });

            mypath.setMap(map);
            myarr = [];
        }

        var image = "images/icon-car-2.png";
        //var image = "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png";
        var shape = {
            coords: [1, 1, 1, 20, 18, 20, 18, 1],
            type: 'poly'
        };

        var infowindow = new google.maps.InfoWindow();
        var mouseover_text, click_text;

        for (var a in coordinates) {

            for (var b = 0; b < coordinates[a].length; b++) {

                if (b == coordinates[a].length - 1) {

                    mouseover_text = coordinates[a][b][0];
                    click_text = coordinates[a][b][3];

                    var marker = new google.maps.Marker({
                        position: { lat: coordinates[a][b][1], lng: coordinates[a][b][2] },
                        map: map,
                        icon: image,
                        shape: shape
                    });

                    google.maps.event.addListener(marker, 'click', function (event) {
                        infowindow.setContent(click_text);
                        infowindow.open(map, marker);
                    });

                    google.maps.event.addListener(marker, 'mouseover', function (event) {
                        infowindow.setContent(mouseover_text);
                        infowindow.open(map, marker);
                    });
                    marker.setMap(map);
                }
            }
        }


    }

    window.onload = initialize;

</script><script async defer src="https://maps.googleapis.com/maps/api/js?key=<map-api-key>&callback=initialize"></script></ContentTemplate> <Triggers><asp:AsyncPostBackTrigger ControlID="mapTimer" EventName="Tick" /></Triggers></asp:UpdatePanel> 

Issue with ModalPopUpExtender

$
0
0

Hi All,

I'm facing a strange (for me) problem using a ModalPopUpExtender.
When I show it everything is good, when I hide it and then I want to show it again it doesn't appear anymore unless I reload the page.
This is the (partial) code of the page:

<cc1:ModalPopupExtender ID="modalSelCorso" runat="server" PopupControlID="pnlSelCorso"
        TargetControlID="LinkButton7" BehaviorID="modalSelCorso" 
        BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender><asp:LinkButton ID="LinkButton7" runat="server"></asp:LinkButton><asp:Panel ID="pnlSelCorso" runat="server" CssClass="modalPopup" Style="display: none" >            <div style="overflow-y: auto; overflow-x: hidden;"><div class="modal-header light-blue darken-3 white-text"><asp:Label ID="Label19" runat="server" CssClass="modal-title" Text="Seleziona Corso"></asp:Label></div><div class="modal-body"><div class="form-group">                    <asp:UpdatePanel ID="updSelCorso" runat="server" UpdateMode="Conditional"><ContentTemplate>                          <div class="table-responsive"><asp:GridView ID="gvSelCorso" runat="server" AllowPaging="True" DataKeyNames = "ID" ShowHeader="false" AutoGenerateColumns="False" CellPadding="0" Font-Names="Calibri" Height="0px" PageSize="15"  align="center" CssClass="table table-striped table-bordered table-hover"
                            OnRowCreated="gvSelCorso_RowCreated" OnPageIndexChanging="gvSelCorso_PageIndexChanging" OnSelectedIndexChanged="gvSelCorso_SelectedIndexChanged"><Columns><asp:BoundField DataField="codice" HeaderText="Codice Corso"/><asp:BoundField DataField="descr" HeaderText="Descrizione"/>                                <asp:BoundField DataField="ID" Visible="False"/>                            </Columns><FooterStyle Height="20%" BackColor="#99CCCC" ForeColor="#003399" /><HeaderStyle BackColor="#0088CC" Font-Bold="True" ForeColor="#FFFFFF" /><PagerStyle CssClass="gridview"/><RowStyle Height="40px" BackColor="White" ForeColor="#003399" Wrap="False"/><SelectedRowStyle BackColor="LightBlue" BorderStyle="Solid" Font-Bold="True" ForeColor="White" />                    </asp:GridView>                </div></ContentTemplate></asp:UpdatePanel></div><div class="modal-footer"><div class="row" style="margin-left: auto; margin-right: auto;"><div class="col-md-12">                                <button id="btAnnSelCorso" runat="server" class="btn btn-danger" title="chiude il popup" onserverclick="btAnnSelCorso_Click">Annulla</button></div></div></div> </div></div></asp:Panel>

So...in the "codebehind" (C#) I show the popup through "modalSelCorso.Show()" (by clicking on a button in the page), it appears (it's a gridview to select an item from the list):
1) if I click on an item, the popup is closed through "modalSelCorso.Hide()" in the "OnSelectedIndexChanged" event: if I click the button to show the popup again, it shows;
2) if I click on "btAnnSelCorso" (thus without selecting an item) the popup closes (modalSelCorso.Hide(), codebehind) but if I click on the button to show it again it never shows anymore, I have to reload the page and then it works

What am I doing wrong?
Thank you, regards.


Roberto

AjaxFileUpload see if files are waiting in the queue to be uploaded

$
0
0

I'm using AjaxFileUpload in a small ASP.Net Web Forms project and it's working well. My application has a few text fields, check boxes, the uploader and a Submit button. When the user clicks the Submit button I need to be able to check the AjaxFileUpload control to see if there are any selected files in pending state and if there are I want to alert the user that there are files waiting to be uploaded. I can't seem to find a way to do this. I need this to happen in the code behind. I know that in the UploadStarted and UploadComplete event I can check "FilesInQueue" but I'm hoping there is a way to check the queue before the user has actually initiated the upload.

Thank you

Tony

TabPanel displaying as links

$
0
0

I've got a tab container with a series of tab panels.  I am running version 18.1.1 of the ajax control toolkit.  If I update to 19.1.0, the tab panels do not display as tabs, but display as links.  I have a custom css library.  I think that my custom css is not being applied.  Here is the code in my tabcontainer.  Any ideas?

<actk:TabContainer ID="tcMain" runat="server"
OnActiveTabChanged="tcMain_ActiveTabChanged"
AutoPostBack="true" CssClass="MyTabStyle" >
<actk:TabPanel HeaderText="Stage" CssClass="ajax__tab_inner" runat="server" ID="tpStage" AccessKey="2">
<HeaderTemplate>
Stage
</HeaderTemplate>
<ContentTemplate>

......

</ContentTemplate>
</actk:TabPanel>
......
</actk:TabContainer>

webServiceFailedNoMsg error received when using autocomplete

$
0
0

Hi

I have been rewriting VB code to C#.  I have written a simple web app that works on my development machine but when I deploy it to the server, I get webServiceFailedNoMsg error.  On the server I use F12 to spot the error but do not have the skill to figure out how to determine what the error is.

Any suggestions and help would be greatly appreciated.

MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:1 POST http://pictures.abc.net/WebService.asmx/Get_Image_Names 500 (Internal Server Error)

MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:1 Uncaught TypeError: Cannot read property 'webServiceFailedNoMsg' of undefined
at Array.it (MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:1)
at MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:1
at Sys.Net.WebRequest.completed (MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:1)
at XMLHttpRequest._onReadyStateChange (MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:1)

This is the web service method

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{
[WebMethod]
public List<string> Get_Image_Names(string prefixText, int count)
{
//https://www.aspdotnet-suresh.com/2011/03/how-to-implement-auto-complete-textbox.html
List<string> my_list = new List<string>();

try
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Immages_Connection"].ToString());
con.Open();
SqlCommand cmd = new SqlCommand("SELECT TOP(@Count) Image_Name FROM Table_Jersey_Images where Image_Name like @Name+'%'", con);
cmd.Parameters.AddWithValue("@Name", prefixText);
cmd.Parameters.AddWithValue("@Count", count);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);

for (int i = 0; i < dt.Rows.Count; i++)
{
my_list.Add(dt.Rows[i]["Image_Name"].ToString());
}
}
catch (Exception)
{
throw;
}

return my_list;
}

And this is my tex tbox and autocomplete.

<div>
<asp:TextBox ID="ImageNameSearchTextBox" runat="server"
style="width:100%">
</asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="ImageNameSearchTextBox_AutoCompleteExtender" runat="server"
BehaviorID="ImageNameSearchTextBox_AutoCompleteExtender"
DelimiterCharacters=""
ServicePath="../WebService.asmx"
ServiceMethod="Get_Image_Names"
CompletionInterval="10"
completionsetcount="10"
enablecaching="true"
MinimumPrefixLength="1"
TargetControlID="ImageNameSearchTextBox">
</ajaxToolkit:AutoCompleteExtender>
</div>


Display slightly off in IE with TabContainer

$
0
0

I'm trying to make some changes in the tab container to increase the size of the text in the tab panels.  I have the following code.  the problem is shown in the image below.  You can see how the image is just a little off and the lines don't meet up.  I've circled the appropriate spots.  It is as if the headers have been moved a couple of pixels above where they are supposed to be.  I am guessing that this is because of the lowercase 'y' extending downward.  I'm looking for any thoughts on removing those few pixels and having things line up as they are supposed to.  TIA

My current css:

.MyTableStyle .ajax__tab_header:after {
    clear: both;
}

.MyTableStyle .ajax__tab_header:before, .MyTabStyle .ajax__tab_header:after {
    content: "";
    display: table;
}

.MyTabStyle .ajax__tab_header {
    font-family: "Helvetica Neue", Arial, Sans-Serif;
    font-size: 30px;
    font-weight: bold;
    display: inline-block;
}

.MyTableStyle .ajax__tab_tab {

}

.MyTabStyle .ajax__tab_header .ajax__tab_outer {
}

.MyTabStyle .ajax__tab_header .ajax__tab_inner {
    font-size: 15px;
}

.MyTabStyle .ajax__tab_hover .ajax__tab_outer {
}

.MyTabStyle .ajax__tab_hover .ajax__tab_inner {
}

.MyTabStyle .ajax__tab_active .ajax__tab_outer {
}

<div>aspx layout:</div> <div>           <actk:TabContainer ID="tabC" runat="server" CssClass="MyTabStyle">
                <actk:TabPanel HeaderText="One" runat="server">
                    <ContentTemplate>One</ContentTemplate>
                </actk:TabPanel>
                <actk:TabPanel HeaderText="Two" runat="server">
                    <ContentTemplate>Two</ContentTemplate>
                    </actk:TabPanel>
                <actk:TabPanel HeaderText="Testy" runat="server">
                    <ContentTemplate>Testy</ContentTemplate>
                </actk:TabPanel>
            </actk:TabContainer></div> <div></div> <div>The result is </div> <div> </div>

CSS not being applied in Chrome as expected

$
0
0

I've got a tabcontainer that I have applied into a tabcontainer (another question).  In IE, the css looks like it is being applied properly and is larger as expected.  The problem is with Chrome (seems to work in Firefox as well).  The larger fonts do not seem to be applied in Chrome.  Here is my code.  Any ideas?

MyTableStyle .ajax__tab_header:after {
    clear: both;
}

.MyTableStyle .ajax__tab_header:before, .MyTabStyle .ajax__tab_header:after {
    content: "";
    display: table;
}

.MyTabStyle .ajax__tab_header {
    font-family: "Helvetica Neue", Arial, Sans-Serif;
    font-size: 30px;
    font-weight: bold;
    /*  display: inline-block;  */
}

.MyTableStyle .ajax__tab_tab {

}

.MyTabStyle .ajax__tab_header .ajax__tab_outer {
}

.MyTabStyle .ajax__tab_header .ajax__tab_inner {
    font-size: 15px;
}

.MyTabStyle .ajax__tab_hover .ajax__tab_outer {
}

.MyTabStyle .ajax__tab_hover .ajax__tab_inner {
}

.MyTabStyle .ajax__tab_active .ajax__tab_outer {
}

aspx layout:

           <actk:TabContainer ID="tabC" runat="server" CssClass="MyTabStyle">
                <actk:TabPanel HeaderText="One" runat="server">
                    <ContentTemplate>One</ContentTemplate>
                </actk:TabPanel>
                <actk:TabPanel HeaderText="Two" runat="server">
                    <ContentTemplate>Two</ContentTemplate>
                    </actk:TabPanel>
                <actk:TabPanel HeaderText="Testy" runat="server">
                    <ContentTemplate>Testy</ContentTemplate>
                </actk:TabPanel>
            </actk:TabContainer>

PS.  For some reason, my image won't upload this morning, but it is just an image in chrome of the text being very normal.

Extra space between tabstrip and content in TabContainer

$
0
0

This is not a problem with the tabcontainer or tabpanel, just something I am doing wrong.  I've fiddled with it for a long time and get it to work right, so I am asking here.

In Google Chrome, I am getting about 3 pixels of extra space vertically between my tab headers and the box containing my content.  I'm clearly doing something wrong.  I have looked at code, compared it to other code that I have working properly, and I can not find an issue.  Does anyone have any suggestions regarding what I should look at?  my css is working in other spots properly for my tabcontainer.  I've tried to dig in with the web inspector in chrome & firefox but no luck.  Any suggestions are appreciated.  TIA.

Tab Index and Update Panel

$
0
0

Hi All,

I'm having an issue where any updatepanel that does an async postback IE 7 and IE 6 will lose the tab order when the partial postback occurs.
Below is some example code you can paste into a new code page and view the issue.  Just run the page in IE and tab, it will work correctly, but if you push the button which does a small postback you will notice the tabindex reset itself. Can anyone explain this or possibly confirm this is a bug.  Ive seen numerous posts that discuss this but only give a javascript solution.  It seems like IE should handle this correctly considering firefox does

<%
@RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

<htmlxmlns="http://www.w3.org/1999/xhtml">
<
headrunat="server">
<title>Untitled Page</title>
</
head>
<
body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true">
</asp:ScriptManager>
<asp:UpdatePanelID="upnlTest"runat="server"UpdateMode="conditional"><ContentTemplate>
<asp:TextBoxID="txtTest"runat="server"AutoPostBack="true"TabIndex="1"></asp:TextBox>
<asp:ButtonID="tstButton"runat="server"TabIndex="2"Text="Push Me"/>
</ContentTemplate></asp:UpdatePanel>
<asp:TextBoxID="txtTest2"runat="server"TabIndex="3"></asp:TextBox>
</form>
</
body>
</
html>


Any thoughts or help with this would be appreciated.

TIA,

AjaxButter

tab index focusing after page post back?

$
0
0

Using this below code you can focus on the next control of the posted control.

ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "FocusOnState", "document.getElementById('" + txtPlacePTN.ClientID + "').focus(); ", true);

Viewing all 5678 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>