i believe... auto complete extender does not work if pagemethods are used directly instead of webservice method with cookieless sessions (possible reason... cookieless session uses session id in url which is not present if pagemehtods are used)
if u r using pagemethod then try using web method defined inside web serivice... and it should work with cookieless session as well..
hope this helps...
Cheers!
KK
Please mark as Answer if post helps in resolving your issue
My Site
if you are using cookieless sessions - the generated script proxy will set the page path to '/pagename.aspx' which will break the PageMethod.
To fix you must reset the path to the page method right before you call your method.
e.g.,
PageMethods.set_path('pagename.aspx') // without the leading '/' which is in the generated proxy
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
/// <summary>
/// Summary description for Searcher
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class Searcher : System.Web.Services.WebService {
public Searcher () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string[] HelloWorld(string prefixText, int count)
{
if (prefixText.Equals("xyz"))
{
return new string[0];
}
Random random = new Random();
List<string> items = new List<string>(count);
for (int i = 0; i < count; i++)
{
char c1 = (char)random.Next(65, 90);
char c2 = (char)random.Next(97, 122);
char c3 = (char)random.Next(97, 122);
items.Add(prefixText + c1 + c2 + c3);
}
return items.ToArray();
}
}
Please mark the replies as answers if they help or unmark if not.
Feedback to us
In an empty solution your example works. But I can't test it in my application (vb.net, and not allowing me to have both cs and vb files in App_code).
There seems to be something wrong with either my web services, or my application as a whole. Control toolkit works normally (Modal Popup extender for example), but can't get autoComplete to work.
thirith
0 Points
4 Posts
Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 07:26 PM|LINK
Hi All,
I have a web page that using AutoComplete Asp.net Ajax Control.
It was working find when the Cookieless is not "True".
I have no idea my it is not working when I set cookieless to "true".
Thanks,
Thirith.
karan@dotnet
All-Star
26228 Points
4596 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 08:06 PM|LINK
How are you calling your pagemethod/webservice
Karan
~ Blog ~
Remember To Mark The Post(s) That Helped You As The ANSWER
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 08:15 PM|LINK
i believe... auto complete extender does not work if pagemethods are used directly instead of webservice method with cookieless sessions (possible reason... cookieless session uses session id in url which is not present if pagemehtods are used)
if u r using pagemethod then try using web method defined inside web serivice... and it should work with cookieless session as well..
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
thirith
0 Points
4 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 08:25 PM|LINK
I have web service implementation in the same page.
The following is the code:
<script runat="server"> <System.Web.Services.WebMethod()> _ <System.Web.Script.Services.ScriptMethod()> _ Public Shared Function GetProductList(ByVal prefixText As String, ByVal count As Integer) As String() //my Code End Function </script> <asp:TextBox ID="Product" runat="server" Width="500pt"></asp:TextBox> <AjaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="Product" ServiceMethod="GetProductList" CompletionInterval="10" CompletionSetCount="20" EnableCaching="true" MinimumPrefixLength="1" CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" FirstRowSelected="true"> </AjaxToolkit:AutoCompleteExtender>karan@dotnet
All-Star
26228 Points
4596 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 08:32 PM|LINK
Try this:
In your page load do this:
PageMethods.set_path('yourpagename.aspx')
Karan
~ Blog ~
Remember To Mark The Post(s) That Helped You As The ANSWER
thirith
0 Points
4 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 08:47 PM|LINK
What does it really mean if we use PageMethods.set_path('yourpagename.aspx')
karan@dotnet
All-Star
26228 Points
4596 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 08:52 PM|LINK
From this post:
http://www.west-wind.com/weblog/posts/152493.aspx
if you are using cookieless sessions - the generated script proxy will set the page path to '/pagename.aspx' which will break the PageMethod.
To fix you must reset the path to the page method right before you call your method.
e.g.,
PageMethods.set_path('pagename.aspx') // without the leading '/' which is in the generated proxy
Karan
~ Blog ~
Remember To Mark The Post(s) That Helped You As The ANSWER
thirith
0 Points
4 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 26, 2010 09:28 PM|LINK
Not working. :(
Song-Tian - ...
All-Star
43705 Points
4304 Posts
Microsoft
Re: Ajax AutoComplete is not working when Cookieless is true
Jul 28, 2010 08:14 AM|LINK
Hi,
Try to use AutoComplete like this, and it is working fine on my side when Cookieless is true.
Aspx:
<form id="form1" runat="server"> <div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSearch" runat="server" AutoPostBack="true"></asp:TextBox> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtSearch" ServicePath="~/Searcher.asmx" ServiceMethod="HelloWorld" MinimumPrefixLength="1" CompletionSetCount="10"> </asp:AutoCompleteExtender> </ContentTemplate> </asp:UpdatePanel> </div> </form>Searcher.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; /// <summary> /// Summary description for Searcher /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class Searcher : System.Web.Services.WebService { public Searcher () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string[] HelloWorld(string prefixText, int count) { if (prefixText.Equals("xyz")) { return new string[0]; } Random random = new Random(); List<string> items = new List<string>(count); for (int i = 0; i < count; i++) { char c1 = (char)random.Next(65, 90); char c2 = (char)random.Next(97, 122); char c3 = (char)random.Next(97, 122); items.Add(prefixText + c1 + c2 + c3); } return items.ToArray(); } }Feedback to us
Develop and promote your apps in Windows Store
Elven
Member
8 Points
33 Posts
Re: Ajax AutoComplete is not working when Cookieless is true
Sep 26, 2010 09:38 PM|LINK
Hi,
In an empty solution your example works. But I can't test it in my application (vb.net, and not allowing me to have both cs and vb files in App_code).
There seems to be something wrong with either my web services, or my application as a whole. Control toolkit works normally (Modal Popup extender for example), but can't get autoComplete to work.
Any ideas what could be the cause?