JQuery :: UI Autocomplete Not Passing Correct Querystring To Ashx Webservice?
Dec 29, 2010
Setup: I have a RadioButtonList with two listitems (One Street, the other Schools). These define what type of search I want. I textbox with associated autocomplete. First you select which search to complete, and then start typing and the autocomplete will make . Autocomplete goes out to ashx webservice which pulls a list from the database.
I have tested the webserver and it works properly, so I'm thinking the problem is with my jQuery UI autocomplete. <div id="divSelectOne" style="padding:8px 3px 8px 3px; border-bottom:1px dotted #cccccc; background:#f9f9f9;"> <span style="font-weight:bold; color:#369;">Select One:</span><br />
<asp:RadioButtonList ID="radSelect" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text=" Street, City, Zip or Subdivision" Value="Street" Selected="True"></asp:ListItem>
<asp:ListItem Text=" School" Value="Schools"></asp:ListItem>
i have using jquery for autocompelete option and iam using ashx file, i have 2textbox, i need to show diffrent search record in the text box, iam using 2 ashx file to show the value using jquery, i want to user single ashx file instead of iam using 2 ashx handle filer can use switch case to handle this , i want to use 7textbox all textbox i need to do autosearch, how to handle this senario using jquery and ashx handler file
clsquery.updatetablestring = "select top 2 Cont_number from ASPrearrival_list where Cont_number"; clsquery.updatetablestring = "select top 2 custid,custname from ASCustomer where custname"; // this is my auto search iam using 2 handler file , i wants only one handler instead of 2handler <script type="text/javascript" src="jquery.autocomplete.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#<%=txtcontno.ClientID%>").autocomplete("Handler1.ashx"); $("#<%=txtcname.ClientID%>").autocomplete("Handler.ashx"); } ); handler ashx file <%@ WebHandler Language="C#" %> using System; using System.Web; using System.Data.SqlClient; using ASbusinesslogic; public class Handler : IHttpHandler { public void ProcessRequest(HttpContext context) { string firstname = context.Request.QueryString["q"]; string sql = clsquery.updatetablestring; sql = clsquery.updatetablestring+" "+"Like"+" '"+ firstname +"%'"; //string sql = "select top 2 mlid,mloname from ASlinermaster where mloname like '" + firstname + "%'"; using (SqlConnection connection = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"].ToString())) using (SqlCommand command = new SqlCommand(sql, connection)) { connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { context.Response.Write(reader.GetString(1)+ "-"+ reader.GetValue(0) + Environment.NewLine); } } } } public bool IsReusable { get { return false; } } } handler1 <%@ WebHandler Language="C#" %> using System; using System.Web; using System.Data.SqlClient; using ASbusinesslogic; public class Handler1 : IHttpHandler { public void ProcessRequest(HttpContext context) { string firstname = context.Request.QueryString["q"]; string sql = clsquery.updatetablestring + " " + "like '" + firstname + "%' "; using (SqlConnection connection = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"].ToString())) using (SqlCommand command = new SqlCommand(sql, connection)) { connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { context.Response.Write(reader.GetString(0) + Environment.NewLine); } } } } public bool IsReusable { get { return false; } } }
Apologies for posting the ten billionth jQuery autocomplete question...I'm having trouble with a jQuery UI autocomplete textbox.I'm unsure if I'm doing the right thing client-side to re-populate the autocomplete data source following keystrokes.The javascript in my aspx page is as follows:
i am using Cascading dropdown, with following scenario.a page "myPage.aspx" is loaded with a Querystring. [http://localhost/myVD/myPage.aspx?jobID=003]this page contains 2 cascading dropdowns say state & City . the idea is to fill the provinces Combo based on INCOMING querystring value "jobid".also i have a webservice named "Mywebservice.asmx" which has webmethods to retrieve city based on jobID.but since these webmethods are Contained in asmx . the querystring of the caller page is not visible to the webmetod of the service.
public CascadingDropDownNameValue[] GetContainerByJobID(string knownCategoryValues, string category ) {
$('#' + textboxID).autocomplete({ delay: delay, source: ["cats", "dogs"] }); which works fine. I want to use a webservice: $('#' + textboxID).autocomplete({ delay: delay, source: webserviceURL}); This doesn't work. My webservice URL is /blah/blah.asmx/myMethod The webservice definition is: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public List<string> myMethod(string term) { // Logic here, return list of strings }
The method never gets called. Can anyone point me in the right direction? I have other webservices in the same .asmx which work fine with other controls (other controls are using $.ajax to call them).
Edit: Getting closer, I now get a 500 error saying Request format is unrecognized for URL unexpectedly ending in '/myMethod'. I think it's not treating my url quite right..
I have been trying for two months to get this code working, and I am close, but still confused. I want the JQuery UI Autocomplete function to call an web service which returns JSON data and display that data for selection, and on selection put the selected value into a hidden field.
There are several issues:
1) The autocomplete function is not firing 2) The source: "/AutoSuggest.asmx/DOTFind?" line throws an invalid object exception 3) The service requires two parameters: (string prefixText, int count) - count tells it how many records to return. 4) I am not at all certain that this code will accept JSON data that comes back from the service
There is an ashx file containing "ProcessRequest(HttpContext context)" method which gets triggered automatically. When and how does it get fired?Another question, How can I get the current QueryString when I am inside this file? When I type "context.Request.QueryString" it says it's null or empty although the address have arguments.
I need to build a proxy (maybe a bad description) that receives an XML file from a 3rd party, saves it, sends it on to another 3rd party, gets the response back and passes that back to the original 3rd party. Let's call that entire process a "unit".Should I use a webservice? A Generic Handler? Something else?
I might have to do 20 "units" per second, but I know that each "unit" may span 30 seconds to a minute each, so really, I mean that I need to be able to have 1200 of these "units" running at the same time, in all varying stages of the process that I described above.As far as the file saving goes, I eventually want to put this into a database, but I would imagine that writing the file is quicker than actually saving the data into a database, so I'll just have another process that isn't nearly as time critical as this grab the files and insert them into the DB at its own convenience.
The "app" will only consist of 1 page and it will be running under SSL. This will likely be the only thing on this server at any given time to ensure that this little process is not a bottleneck.What in .Net would be a good (fast and scalable) way to go about this? I don't have any effective limit on what I would need as far as hardware goes -- so I can get a screaming machine if it would guarantee no bottlenecks.
I'm using jQuery AutoComplete Plugin in ASP.Net as outlined in the article below, so that as a user types in a .Net textbox they get a list of options to choose them. This works fine, but what I need to do now is call a server side function when the user has finished typing or has choosen a value, rather than the user having to submit the value by pressing a button.
I am using autocomplete extender in my project with the external webservice. The problem what I am facing is I need to pass credentials to connect to the webservice, as this service is hosted in different domain.
I need to access a resource file in a web application, using a WCF web service.The webservice will be hosted in the same domain as the web application, but its business logic is in another assembly.
How can I retrieve the correct resouce file (according to the current culture) from the business layer, and returning a List of KeyValue pair from it?
I have a datalist that I want to list the Products that are comming from the Querystring. It works like this: Default.aspx/?ProductID=1 I get 1 product like I want.But I want to add more products like this Default.aspx/?ProductID=1,15,25 and get three products back. How do I make that to work?
On my page I have textbox in which user enters value. When 3 values are entered the autocomplete panel shows.In the panel the names and surnames of all available people are shown bassed on the value user enters. Bellow each name and surname is picture of each "candidate". However images are stored on another server (using https "protection") and some people don't have picture.
onerror="this.onerror=null;this.src='../Pics/Errors/NoPic.jpg'" into <img> tags in Web Handler.
I have created webpage and I am calling it from Jquery function. Technically I am {info} is image button and I am replacing with it with aspx
.replace("${info}","/_layouts/webpage.aspx");
The web page is opening in new browser window. Is there any way that I could make it as pop up whereever I can place in the page. That is get rid off the toolbar address bar. It should look like a pop up.
Can we pass querystring in the same page?? if yes then how ?i am using Tab Container control of AJAX Toolkit and in that i have 5 tabs all of them gets the value through querystring from another page but i want to pass different querystring to tab no 4 so for that i am trying to pass another querystring on the same page on TabContainer1_ActiveTabChanged event.i give another querystring to tab no 4
This may be a simple question, but I'm trying to call a a value from table in my back-end SQL Server database and pass it through a querystring in the URL. For example:
I'm building a mobile web site that registers a mobile device to an account on the sign up page. After the database entry is created, I want the to get the generated deviceId from the database and pass it to a querystring in the URL such as: http://www.mobilewebsite.com?dId=22
Is this easily possible, or is it even the best solution for what I'm trying to accomplish?
I am trying to pass a URL Querystring to a custom assembly. How can I accomplish this. I need to store the querystring value into a parameter, but it has to be decrypted (This is what the custom Assembly does). I have tried to first put it into another parameter and then call that using=Code.MyClass.DecryptMe(Parameters!Eq.Value)But it doesn't get any value from the Eq parameter. how can I accomplish this?What is the best way to get the Querystring into the custom assembly
I've been trying to use the jQuery plugin Colorbox to display images I have in my DB through an ashx file. Unfortunately it just spits a bunch of gibberish at the top of the page and no image. Can this be done? Here is what I have so far:
$(document).ready ( function () { $("a[rel='cbImg']").colorbox(); } ); ... <a rel="cbImg" href="HuntImage.ashx?id=15">Click to see image</a>