I have removed the .asmx file and now try to run the Webmethod directly in the .ascx instead.
It works in a ASP.net WebApplication Webform(.Aspx Web Form)
[System.Web.Services.WebMethod] public static string[] GetNames(string prefixText, int count) { List<String> hits = new List<String>(); SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source=(local);Initial Catalog=umbracodb;Integrated Security=True"; conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.Parameters.Add("@Input", SqlDbType.VarChar, 50); cmd.Parameters["@Input"].Value = "%" + prefixText + "%"; cmd.CommandText = "SELECT [Name] FROM [Product] WHERE [Name] like @Input"; cmd.ExecuteNonQuery(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { hits.Add(reader["Name"].ToString()); } conn.Close(); conn.Dispose(); return hits.ToArray(); }
I get no errors but no response from the textbox with autocompleteextender in a user control(.Ascx) on my umbraco site
[System.Web.Services.WebMethod] public static string[] GetNames(string prefixText, int count) { List<String> hits = new List<String>(); SqlConnection conn = new SqlConnection(GlobalSettings.DbDSN); conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.Parameters.Add("@Input", SqlDbType.VarChar, 50); cmd.Parameters["@Input"].Value = "%"+prefixText+"%"; cmd.CommandText = "SELECT [Name] FROM [Product] WHERE [Name] like @Input"; cmd.ExecuteNonQuery(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { hits.Add(reader["Name"].ToString()); } conn.Close(); conn.Dispose(); return hits.ToArray(); }
Bold marks the only difference in the code itself
This aint a forum for AJAX extensions, I am aware of that. But I am curious since the code runs fine in a standard ASP.net WebApplication but not as an usercontrol exported to Umbraco
I am facing for same problem, but this is not working, when I use pagemethod and just set servicemethod on ajax control , I cann see page automatically set to servicepath to page it selef but noting happen. I have added all Ajax dll files and folders with dll to website and build my usercontrol application and then copy that dll to.
but this is not work. I tried to copy asmx file to root directory of website and call that on autocompleteextender ServicePath=http://www.website/webservice1.asmx not working then try just service name without http.... how do i solve this problem.
I have to solve this problem please any one can help me on this. It seems umbraco does not like the webservice call from usercontrol. I have copy webservice to websie root folder and gave servicepath as url but still this is not working. anyone can help to sort use of autocomplete asp.net ajax control in mbraco usercontrol please .......
I have sorted this problem, now my asp.net ajax work with webservice saved in root folder of the website and change config file according to the following article.
Webservice problem Ajax autocompleteextender
Hi.
Ive run into a problem while creating a usercontrol using ajax autocompleteextender.
I get no errors but I am unsure if my usercontrol finds the webservice which right now is set to:
ServicePath="~/autocomplete.asmx" and is placed in the same folder as my ascx usercontrol(Umbracoroot/usercontrols)
Where should I place my webservice(autocomplete.asmx)?
Anything else I need to consider?
I have removed the .asmx file and now try to run the Webmethod directly in the .ascx instead.
It works in a ASP.net WebApplication Webform(.Aspx Web Form)
[System.Web.Services.WebMethod]
public static string[] GetNames(string prefixText, int count)
{
List<String> hits = new List<String>();
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=(local);Initial Catalog=umbracodb;Integrated Security=True";
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.Parameters.Add("@Input", SqlDbType.VarChar, 50);
cmd.Parameters["@Input"].Value = "%" + prefixText + "%";
cmd.CommandText = "SELECT [Name] FROM [Product] WHERE [Name] like @Input";
cmd.ExecuteNonQuery();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
hits.Add(reader["Name"].ToString());
}
conn.Close();
conn.Dispose();
return hits.ToArray();
}
I get no errors but no response from the textbox with autocompleteextender in a user control(.Ascx) on my umbraco site
[System.Web.Services.WebMethod]
public static string[] GetNames(string prefixText, int count)
{
List<String> hits = new List<String>();
SqlConnection conn = new SqlConnection(GlobalSettings.DbDSN);
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.Parameters.Add("@Input", SqlDbType.VarChar, 50);
cmd.Parameters["@Input"].Value = "%"+prefixText+"%";
cmd.CommandText = "SELECT [Name] FROM [Product] WHERE [Name] like @Input";
cmd.ExecuteNonQuery();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
hits.Add(reader["Name"].ToString());
}
conn.Close();
conn.Dispose();
return hits.ToArray();
}
Bold marks the only difference in the code itself
This aint a forum for AJAX extensions, I am aware of that. But I am curious since the code runs fine in a standard ASP.net WebApplication but not as an usercontrol exported to Umbraco
Hi, am having the same problem...did you ever get a solution?
thanks
Rory
I am facing for same problem, but this is not working, when I use pagemethod and just set servicemethod on ajax control , I cann see page automatically set to servicepath to page it selef but noting happen. I have added all Ajax dll files and folders with dll to website and build my usercontrol application and then copy that dll to.
but this is not work. I tried to copy asmx file to root directory of website and call that on autocompleteextender ServicePath=http://www.website/webservice1.asmx not working then try just service name without http.... how do i solve this problem.
please give expert ideas.....
check you can call the webservice directly from the browser. If not, then debug that first. This is what fixed it for me.
Rory
I can browse to webservice, show me the method . but i cannot test it "The test form is only available for requests from the local machine. "
how did you call service path in ajax control
as http:www.wesitename/webservice1.asmx or different?
<asp:AutoCompleteExtenderID="AutoCompleteExtender1"runat="server"TargetControlID="txtdestinaion"
ServicePath="http://www.mysitename.co.uk/DestAutoComplete.asmx"ServiceMethod="GetList" ....
I have to solve this problem please any one can help me on this. It seems umbraco does not like the webservice call from usercontrol. I have copy webservice to websie root folder and gave servicepath as url but still this is not working. anyone can help to sort use of autocomplete asp.net ajax control in mbraco usercontrol please .......
any other solution would be ok too.
I have sorted this problem, now my asp.net ajax work with webservice saved in root folder of the website and change config file according to the following article.
http://msdn.microsoft.com/en-us/library/bb763183.aspx?ppud=4
is working on a reply...