Autocompleteextender not working inside an user control tried all ways. i have a custom function.. inside the cs file itself like the following :-
[Code]....
I did something like this and it worked properly when it was in aspx but when i changed all this to ascx and when i added the user control in aspx the autocomplete is not working. say enablecontext = false; i have even tried that.. its not even reaching till that function. moreover i need contextkey to validate different autocomplete controls inside my page.
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.asmxhttp://192.109.1.8/Test/WebService.asmxand i tried ~/Test/WebService.aspxWhile 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.
I tested the web service.it is working fine.The problem that i want to solve is to make call to webservice. Here is the .aspx code
<asp:TextBox ID="txtFullName" runat="server"></asp:TextBox> <ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtFullName" ServiceMethod="FindFullName" ServicePath="../WebService.asmx" EnableCaching="true"></ajaxToolkit:AutoCompleteExtender> Webservice code : using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; using System.Configuration; using System.Data.SqlClient; using System.Data; using System.Collections; using System.Collections.Generic; /// <summary> /// Summary description for WebService /// </summary> [WebService(Namespace = "[URL]/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class WebService : System.Web.Services.WebService { public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] public string[] FindFullName(string prefixText) { string sql = "Select FName from Investigators Where FName like @prefixText"; SqlDataAdapter da = new SqlDataAdapter(sql,"Data Source=vvvvv;Initial Catalog=vyyyd;Persist Security Info=True;User ID=PowetttrUsyyer;Password=888888); da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = prefixText+ "%"; DataTable dt = new DataTable(); da.Fill(dt); List<string> liste = new List<string>(); foreach (DataRow dr in dt.Rows) { liste.Add(dr.ItemArray[0].ToString()); } return liste.ToArray(); } }
I have a textbox with the autocompleteextender in VS2010 that is referencing a webservice. However, nothing I seem to do makes this work as no values are returned when I begin typing in the textbox. When I view the webservice in my browser and invoke it, it returns values so I know that my webservice works. Code below.
I have created a real simple templated UserControl and
I can now add this control to my Asp.net WebApplication using:
[code]...
i can embed this in a page (aspx) but i is not working in usercontrol (ascx). when i use this inside usercontrol, the designer file (.ascx.designer.cs) itself not getting generated.
getting the following error:
Element 'Box' is not a known element. This can occur if there is an error in the webpage, or the web.config file is missing.
Update: sometimes it works! i created couple of controls. it works in some place and it doesnot works in someother place.
I got the auto complete extender working with the database, but will show the autocomplete only if the data is less than around 500 records.... anything above that, and the exntender will not show at all.... Does the auto complete extnder have a limit on the number of records?.
i have an asp.net application in which i have used autocomplete extender now when i deploy it on the server (2003 and iis 6) the autocomplete extender does not work .. i looked on the net and found out the system.web.extensions system.web.extensions.design dll are needed for it, it was not present so i added them to the gac still it is not working i have .net3.5 sp1 instaled on the server.
I tried your code for Autocomplete without Webservice and didn't work on my page. When I tried it on a new project it works fine but on my project it does not. I have other controls on the page but that shouldn't stop it from working right?
In the upper code... AutCompleteExtender1 works perfectly... AutoCompleteExtender2 not working at all. Same web service, same method... both are inside the same .aspx file... both have exactly the same conditions.What is it that I am missing? And if you think that it is because they both calling the same service and method it is not... the second doesn't work with different service or different method (both inside the same service and in the different .asmx file).Can it be, that you simply can't have 2 ACE controls on the same page?And btw, is it possible to run server code once someone selects something from ACE control?
I have one web application which is accessible via to different IP addresses (one of them is virtual) now the application is running smoothly when accessed via the original ip address but when the same application(website) is accessed via the virtual ip address the autocomplete extender is not working it is flashing a javascript error 'Stop running the script? A script on this page is causing internet explorer to run slowly
I have added autocompleteextender in page . It was working without parameters , when i have added parameters "pretext","count" it stops working. below are my code :
<div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> <Services> <asp:ServiceReference Path="~/Admin/WebService1.asmx" /> </Services> </asp:ToolkitScriptManager> <asp:TextBox ID="TextboxCompletelist" runat="server"></asp:TextBox> <asp:AutoCompleteExtender ID="TextboxCompletelist_AutoCompleteExtender" runat="server" ServiceMethod="GetCompletionList" Enabled="True" ServicePath="~/Admin/WebService1.asmx" TargetControlID="TextboxCompletelist" CompletionSetCount="10"> </asp:AutoCompleteExtender> </div> namespace AgentService [WebService(Namespace = [URL] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class WebService1 : System.Web.Services.WebService { [WebMethod] public static string[] GetCompletionList(string PrefixText, int count) { string countryname; SqlParameter[] parm = new SqlParameter[1]; parm[0] = new SqlParameter("@PrefixText", PrefixText); DataTable dt = SqlHelper.ExecuteDataset(AppSetting.ActivateConnection, CommandType.StoredProcedure, "FetchAutoCompleteStates",parm).Tables[0]; List<string> items = new List<string>(); for (int i = 0; i <= dt.Rows.Count-1; i++) { countryname = dt.Rows[i]["statename"].ToString(); items.Add(countryname); } return items.ToArray(); }
i have a javascript color picker i can get it working fine in a aspx page, but i am unable to get it working in a usercontrol inside a update panel. I have tried using the following but i still cannot get it to workm the js file can be viewed at [URL]
[URL] .... This is my older post on this question .
Now my datalist is under update panel hence on changing dropdownlist my textbox for city won't cascade. How can I update the context key on dropdownlist selection change ?
I use the tabpanel and place it in a usercontrol. but the text in the tab header are cut off when opened in IE6 and IE7. in mozilla this is working properly. i am loading this usercontrol in a webpart so i can add it in any page in my site.
I am loading the autocomplete extender properly but I need the PK from the selectedValue. I have looked at other examples and they do NOT show how to drill into the tabcontainer, then drill into the listview, and then locate the extender value. Here is what I have so far. My "TABCONTAINER" value shows the extender correctly but I am unable to locate it.
Using ASP.NET 3.5 / C#. Have a page with a UpdatePanel, and a UserControl inside the UpdatePanel. When calling ScriptManager.RegisterClientScriptBlock(this, typeof(UpdatePanel), Guid.NewGuid().ToString(), script, false); the script appears to fire (have tried it with a JS alert), but the resulting script also disappears immediately afterword. I am trying to create a JS function via the script, and it is not in the Page Source after the Page is rendered. i have tried many variationsRegisterClientScriptBlock with no luck.
I've a ASP.Net page (Default.aspx) which will load UserControl (ucontrol.ascx) dynamically into an UpdatePanel. By using UpdatePanel, we believe we're able to prevent the entire page to be posted-back.
My problem is, within the UserControl, we have some form controls, such as inputs and buttons; after the UserControl is loaded, clicking on any button inside the UserControl will cause the UpdatePanel to be blanked. During the investigation, I found that, breakpoints within the Button1_Click() in the code-behind for the UserControl is never reached. Please reference to the code below, this references to [REFERENCE]1.
I just create a js file and write all my codes into it after i added this file to UserControl and after i get this UserControl's html i use $("#DivID").html(UserControlHTML);
Its working now.
Hi everyone;
Im using Ajax and Webservice to load UserControls. Its ok i can easily get the html code of UserControl but there is a problem.
For example UserControl's html code is something like that.
<h3>Header</h3> <div id="content"> <p>lorem ipsum dolor sit amet...</p>[code]....
When i get this html code and insert it to an div's innerHTML.html looking as it should. But javascript codes which written on usercontrol not working.It should give me alert but its not.
i have tried autocompleteextender using page method and without master page and its working. but now im try to put them into master and its not working. this is my code***********pagename.ascx
following is the code i am using and it is not working.
<asp:TextBox ID="txtWarrantNumber" runat="server"></asp:TextBox> <AjaxCtrl:AutoCompleteExtender ID="acWarrantNumber" runat="server" TargetControlID="txtWarrantNumber" ServiceMethod="GetWarrantNumber" ShowOnlyCurrentWordInCompletionListItem="true" CompletionInterval="100" EnableCaching="true" MinimumPrefixLength="1" CompletionSetCount="4"> </AjaxCtrl:AutoCompleteExtender> </ContentTemplate> </asp:UpdatePanel> </PopupTemplate> Public Shared Function GetWarrantNumber(ByVal prefixText As String, ByVal count As Integer) As String() Dim warrantNumbers() As String = {"ankit", "sachin", "ankrrr", "ankppp"} Return warrantNumbers End Function