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

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>


Viewing all articles
Browse latest Browse all 5678

Trending Articles



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