.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

AJAX AutoCompleteExtender Not Calling WebMethod

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
I have the correct signature for the web method, and it works fine,  but for some reason it is not being called at all by AutoCompleteExtender<div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> <Services><asp:ServiceReference Path="~/AutoComplete.asmx" /></Services> </asp:ToolkitScriptManager> <asp:TextBox ID="txtUser" runat="server"></asp:TextBox> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtUser" ServicePath="~/AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="1" EnableCaching="true" UseContextKey="false"> </asp:AutoCompleteExtender> </div>  Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Web.Script.Services Imports System.ComponentModel Imports System.Data.SqlClient ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. ' <System.Web.Script.Services.ScriptService()> _ <System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _ <System.Web.Services.WebServiceBinding(ConformsTo:=WsiP

View Complete Post

More Related Resource Links

Using Ajax AutoCompleteExtender on dynamic fields



I have quite a problem with a form that contains an autocomplete function. The page is an aspx page with c# codebehind.

On the form there is an address field that the user can type in any string address. This field is using an Ajax autocomplete extender, which suggests roadnames to the user. This works fine.
Furthermore the user has the option to add multiple address fields when clicking a button. This works fine now with Jquery. Jquery copies the table which contains, besides other fields, the address field, and "paste" it underneath the existing adress field.

Problem is, how do I attach the Ajax autocomplete extender to the address fields that gets added? Or is there another workaround to make all these fields have this autocomplete function?

Here is my simplfied code:

aspx page:

<td width="200">
  <asp:TextBox ID="TextBoxStopRoadName" runat="server" Width="200"></asp:TextBox>
      <asp:AutoCompleteExtender runat="server"

Ajax AutocompleteExtender not working from IIS


I am using  AjaxAutoCompleteExtender  in my asp.net program (C#) . I am applying the extender to a texbox and using internal Web Service. I am getting the desired result, when i am running from the development environment. After Publishing the site to IIS, I am not getting the list and not showing any errors. I have turned off custom errors. My website is not an Ajax Enabled WebSite. So i added the lines into my Web.Config.

I tried all service path.. http://localhost/Test/ WebService.asmx

and i tried ~/Test/WebService.aspx


While testing from the development environment, i am using the last one.

I am not sure whether this is the problem with the service path or any permission issue.



how to use autocompleteExtender in ASP.net AJAX

In the tutorial for autocomplete text box for static page method in c# the following lines of code is given. When i use it my website using c# it gives error 'invalid term "in" showing in line 7. Why is it so.Plz help me. [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]   public static string[] GetCompletionList(string prefixText, int count, string contextKey) {       // Create array of movies       string[] movies = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"};          // Return matching movies       return (from m in movies where m.StartsWith(prefixText,StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();   } 

Simple return value from WebMethod from Ajax function using JQuery


I have an Ajax function called from JQuery that goes to a webservice to return a value.  I need a SIMPLE example on how I can do this.  I've been going nuts with serializing and every other aspect of this topic. 

I need to return either an ArrayList with ONE string field or a DataTable of some kind.  Either way, I'm populating it into a DropDownList.

I'm willing to consider alternatives to this idea. (Background info - I get a value from a textbox and I need to run it through a DB to get an associated value or set of values).  I'm being really general so that someone can show a simple example.  Thanks.

Ajax AutoCompleteExtender displaying incorrectly or causing javascript errors


I have an autocomplete extender working well with IE and Firefox but it is either displaying incorrectly or causing the error below in Chrome and Safari.

Displaying incorrectly: At times the autocomplete list appears in the lower right corner of the browser.  It still works at this point though.

Error: The list stops appearing along with the halting of all of the JavaScript on the page.  I captured the error (see below).  In order to get the page to operate correctly again, I have to refresh the page.

Things to note:

  • There are two autocomplete extenders on two separate textboxes both of which trigger an asynchronous post-back that updates the value of the other (to ensure the data is correct according to the database).
  • These are both located in an update panel that triggers the a-post-back.
  • I have customized the CSS but when I set the CSS back to the defaults for AjaxControlToolkit there was no change to the behavior described above.

Thank you in advance for your help!


Uncaught TypeError: Cannot call method 'show' of null


Calling a javascript function from server side, using AJAX timer



I am developing a ASP.NET ajax application.
I am using a timer:

<asp:Timer ID="Timer1" runat="server" OnTick="Timer_Tick" Interval="5000" />      

The only thing I want to do is to call a javascript function on every tick of the timer:

 protected void Timer_Tick(object sender, EventArgs e)
            ClientScript.RegisterClientScriptBlock(this.GetType(), "blink", "<script>blinkit('2');</script>");

This doesn't work.
The javascript function is being called only if I put the 'RegisterClientScriptBlock' in the Page_Load.

How can I call the javascript every couple of seconds?

Thank you

JQuery function is not calling when JQuery Ajax method succeed


Hi I am doing a small application in asp.net using JQuery
<script language="javascript" type="text/javascript">
        $(document).ready(function() {
            var imgPoll = new Image();
            imgPoll.src = 'images/red-bar.png';
            if ($("#divVoted").length > 0) //Already

Calling action on Controller via AJAX


Hi All

I'm working on a forum application using MVC 2.0. I've built a basic page listing all the forum posts, held in a database and I've added a simple section on the bottom for a user to add a new post:

<% using (Ajax.BeginForm("AddChat", "Chat", new { text = Model.AddChat.Text}, new AjaxOptions { OnSuccess = "handleSuccess" }))


                <%: Html.ValidationSummary(true)%>





                        <div class="editor-label">

                            <%: Html.LabelFor(model => model.AddChat.Text)%>



(400) Bad Request when calling asmx webmethod dynamically


I am getting (400) bad request when I try to get response from the asmx webservice. Till now, I am able to run the service url provided by the user and get all the webmethods in a dropdown. I then create a SOAP message for the selected webmethod. When user clicks Execute button, I am trying to call the webmethod with SOAP message. Here is the c# code:

protected void btnExecute_Click(object sender, EventArgs e)
  HttpWebRequest req = (HttpWebRequest)WebRequest.CreateDefault(new Uri(txtWSDL.Text));
  req.ContentType = "text/xml; charset=utf-8";
  req.Method = "POST";
  req.Accept = "text/xml";
  req.Headers.Add("SOAPAction", "http://tempuri.org/" + ddlMethods.SelectedItem.Text);
  StreamWriter stm = new StreamWriter(req.GetRequestStream(), Encoding.UTF8);


Microsoft AJAX CDN

Content delivery networks (CDNs) are composed of "edge cache" servers that are strategically placed around the world at key Internet network points. These "edge cache" servers can be used to cache and deliver all types of content - including images, videos, CSS and JavaScript files.

Using a CDN can significantly improve a website's end-user performance, since it enables browsers to more quickly retrieve and download content. For example, instead of having a browser request for an image traverse all the way across the Internet to your web server to download, a CDN can instead serve the request directly from a nearby "edge cache" server that might only be a single network hop away from your customer (making it return much faster - which makes your pages load quicker).

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

GridView Paging Using Ajax in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

Using jQuery to directly call ASP.NET AJAX page methods

Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend