My site has 2 web service, one connects to the database, the second one calling the data from the first web service. I try to make a web application with AutoComplete Extender using Page Method from existing search.This is the search code:
Imports App.svcNewApp
Imports System.Web.Services
Partial Public Class AppSearch
i have developed a AutoComplete Search with the JAX AutoCompleteExtender Now i found a solution to use these control without a webservice (amsx) you only have the function in the codebehind (default.aspx.cs) , to do this you must let theServicePath empty. In the codebehind of your webpage is only the function which gets the data from the database.Important the function must be static !! Here is a good description: http://allwrong.wordpress.com/2007/03/13/ms-ajax-autocomplete-extender-using-a-page-method/
[Code]....
default.aspx.cs
[Code]....
Letīs come to my problem, i wanted to store these functionality in a webcontrol => AutoCompleteSearch.ascx So i put the code from the default.aspx an .cs in the AutoCompleteSearch.ascx control. After i started the webapplication there was no functionality. So tried to let the
web service method(getMainHeads) with parameter is not calling with auto complete text box extender(same method with out parameter is calling fine). My Service is
[System.Web.Script.Services. ScriptService] public class InvService : System.Web.Services.WebService { ItemMainHeadMsts objItemMainHeadMsts; DatabaseHelper objDataHelper; [WebMethod] public string[] GetMainHeads(string value) { List<string> oList = new List<string >(); objItemMainHeadMsts = new ItemMainHeadMsts (); objDataHelper = new DatabaseHelper (); objItemMainHeadMsts = ItemMainHeadMstBase.SelectByFieldAuto("IMHDesc" , value); foreach (ItemMainHeadMst mainHead in objItemMainHeadMsts) { oList.Add(mainHead.IMHDesc); } return oList.ToArray();..........................
public class WebService : System.Web.Services.WebService { MySql.Data.MySqlClient.MySqlCommand cmd = new MySqlCommand(); MySql.Data.MySqlClient.MySqlConnection con = new MySqlConnection(); //MySqlDataAdapter da = new MySqlDataAdapter(); MySqlDataReader dr; public WebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string[] GetCountryInfo(string prefixText) { int count = 10; string sql = "Select * from tbl_patientmaster Where P_NAME like '" + @prefixText + "%'"; con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["HMSDBConnectionString"].ToString(); con.Open(); MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, con); da.SelectCommand.Parameters.Add("@prefixText", MySql.Data.MySqlClient.MySqlDbType.VarChar, 50).Value = prefixText + "%"; System.Data.DataTable dt = new System.Data.DataTable(); da.Fill(dt); string[] items = new string[dt.Rows.Count]; int i = 0; foreach (System.Data.DataRow dr in dt.Rows) { items.SetValue(dr["P_NAME"].ToString(), i); i++; } return items; }
i have a problem with autocomplete control i used in my page, but it does not works so, i do not know how to debug it for finding some problem i tried also to create new page and insert only textbox and autocomplete control...again does not works.... which is wrong?
I have a text box and ajax autocomplete control extender in my Master Page that it is not working at all. When I type some characters on the text box it doesn't trigger the autocomplete. I have a web service that contains the function code. I est my code on a single Web Page (No Master Page) and it works perfectly. Also, it works fine if I include the text box and the extender on the Content Page instead of on the Master Page. It is important to keep the text box in the Master Page for me. I am using Visual Studio 2008 and ASP 3.5. MASTER PAGE.
I wrote a page Page method in my aspx page. in web service method I need to call FindControl method return textbox and get text box value. But my findControl will take MasterPage object to iterate.
code.<script type = "text/javascript"> function ShowCurrentDateTime() { $.ajax({ [code]....
But I am getting compiler error when use Page.Master: Reference to non-shared member requires an object reference
How to pass Master Page object or Page to Page method?. So I can use in Sared method.Is there any way I can access Textbox value directly in Page method? I need access couple of controls in Page Method.
I added the extender and when i tried to add the method this message poped up; Cannot create page method "GetCompletionList" because no Code Behind or codefile was found.
I have an input box for searching employee info (attached to a jquery autocomplete), and a box for employee number. The employee info queries multiple values (Lastname Firstname, Title, Clocknum) and returns them all as a string via the autocomplete. This is only if they dont know the clock number. The additional box is so they can search via clocknum as well.
Is there a way, to fire a method which populates a data control after clicking on or tabbing on the selected jquery autocomplete value?
I'm using a custom AJAX based validation control to check user name availability from database. It's working alright in my development machine but in production server we are using Windows Authentication to authenticate by domain.The control is inherited from base validator and checks for user name availability from database perfectly but on form submission at Page.IsValid check it gives the following error.
remote server returned an error 401 unauthorized
Both the form and webmethod are in the same page/file. I even tried creating webmethod in a separate standalone webservice but error still there.
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
I don't know why, but even using update panel, my postback method updates the entire page. I'm using a master page with aspScriptManager inside. My ASP.Net code: <div> <asp:UpdatePanel ID="updProva" runat="server"> <ContentTemplate> <asp:Panel ID="pnlProva" runat="server"> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> </div>
The CodeBehind (C#) creating some RadioButtonList controls in my ASP.Net page, I'll post the main function and de Page_Load: createTest function [Code].... Finally, the Page_Load: [Code]....
I have .aspx page methods with return type of string, which work great. I am using some jQuery ajax, and some .NET Ajax "PageMethods.methodName" syntax from the client side to successfully call these page methods. I need to return xml from a page method.... I would LOVE to be able to return system.Xml.Linq.XElement type from page method. I get a serialization circular reference error when I attempt to return XElement or XDocument. I don't really want to return XML.ToString() to client, and then convert string to xml in javascript. What return page method return type(s) would allow me to retrieve xml with jQuery ajax call? I know json is the alternative, but will not give me what I need this time.
I looked up the threads about this. But I couldn't do it...
this is my method in aspx.page:
public void MesajlariGetir() { DataSet ds = new DataSet(); SqlConnection con = new SqlConnection(); SqlCommand cmd = new SqlCommand("msjlarigetir", con);
I have this slideshow extender that works perfectly with hard coded images in the page method. However as soon as I try to make the page method get its images from the database it stops working; no images are returned.
I have tried to declare the datatable that the pagemethod uses both inside the pagemethod and in the on_load event. When in the last case I test the datatable contents by hooking it up to a gridview, it shows that it does get its proper data.
Declaring this dataTable as a private static dataTable, outside the page_load, to make it accessible in the page method (like in this --- post http://forums.asp.net/p/1115257/1726736.aspx---) also does not work.
So the page method with hard coded images works and also the query to the database works!
I am tring to use Jquery autocomplete into my asp.net 2.0 application, I have all necessary file in place, I tried to worked on , but it seems like this is not working,can some one tell me that is asp.net 2.0 application without using AJAX toolkit works with Jquery autocomplete or it does not work?Note: this is plain asp.net 2.0 web application, it is not using AJAX.
I m facing problem updating a method which shows the count on master page. That method is bind to treeview control.Whenever a data is saved count is incremented to one. but method gets refreshed only when there is a postback. I want it to be updated after every few seconds or whenver there is data saved. there is pretty gud solution with custom ajax that is with json. But that is not possible with exiting solution.i have to redesign the complete treeview structure in html. And with timer control of ajax whole page gets refreshed.
Im loading a popupextender (its in a WebUserControl)via LoadControl dynamically in to page. how can I force to run a page method when I click OK button in WebUSerControl? simply type casting of page like (_DefaultPage)Page.Calculate() doesnt working.
I'm trying to show some data in the update panel refreshing every second using page method. Everything works fine until I introduce Session. As soon as I save some data into the session my Ajax Page method is not called every second. Here is the complete code
Test.aspx
[Code]....
Test.aspx.cs
[Code]....
why after clicking "Enable Session" button refresh stops working?
I have an application that has JS calling ASMX files to do asyncronous requests, using ASP.NET AJAX.
The problem is that I use always the same "onError" function, and now I don't know how to identify the method that rised the error, and it is giving me a lot of problems to debug errors. The parameter "data" of the onError method does not give enough information, for example:
en System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value) en System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) en System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) en System.Web.Script.Serialization.ObjectConverter.ConvertObjectToType(Object o, Type type, JavaScriptSerializer serializer) en System.Web.Script.Services.WebServiceMethodData.StrongTypeParameters(IDictionary`2 rawParams) en System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters) en System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams) en System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)
Is there any way to know the webmethod that raised the error?