AJAX :: Autocomplete Control Does Not Work Using In Page
Aug 4, 2010
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?
[Code]....
[Code]....
View 3 Replies
Similar Messages:
Apr 7, 2010
I've been racking my brains out trying to get this to work. I've followed multiple tutorials to the letter and I have had no luck.
Here is my Default.aspx page:
[Code]....
Here is my WebService.asmx.cs file:
[Code]....
I don't know what else there is to do. I have a zip of my solution here: [URL]
Edit: I forgot to add that I am able to run the WebService by itself. It returns the values from the function. The function is never invoked from the aspx though.
View 11 Replies
May 6, 2010
Why my autocomplete ajax script does not work:
This is my WebService.cs
[Code]....
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" MinimumPrefixLength="1" ServiceMethod="GetCountryInfo" TargetControlID="TextBox2" ServicePath="WebService.asmx" runat="server"></cc1:AutoCompleteExtender>
Categories row in database is text type...
I use ModalPopup, too(my textbox2 is in Modalpopup), does it makes problem?
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" MinimumPrefixLength="1" ServiceMethod="GetCountryInfo" TargetControlID="TextBox2" ServicePath="WebService.asmx" runat="server"></cc1:AutoCompleteExtender>
View 7 Replies
May 20, 2010
I have the following situation in my page: I've created a textbox and then set an AutoCompleteExtender to this textbox and, later I wanted to set the focus to this field with the code behind i set textbox.focus(), when i'm trying to add focus the AutoCompleteExtender simply not working, but when i click outside the text box and click back in , it's working.
Can anybody give me a simple explanation how to solve this situation.
View 1 Replies
Jul 22, 2010
I'm having a problem with AutoComplete tool see demo here [URL]
When enter 123 for first time, it works. Then click somewhere to close the result, clear textbox enter same value, it does not work. I got a description "...Caching is turned on, so typing the same prefix multiple times results in only one call to the web service." I tried turning off cache, but still not work.
View 2 Replies
Jun 11, 2010
I'm new here and I need some help to use the AutoComplete Extender. I just have a default.aspx with a textbox extended with an AutoComplete. My Web Service calls a SQL Data Base thru Linq and return some account names.When I execute the WEB SERVICE and manually insert the parameters, it works! But when I execute the default.aspx, nothing happens. I really apreciate your help! See the CODES listed below:
See the Web Service code below:
[Code]....
Now, the code on DEFAULT.ASPX
[Code]....
I tried put the files in a remote SERVER, and I got the following error (in LOCALHOST I don't see that error):
Configuration Error
Server Error in '/PC' Application.
Configuration Error
Description:
An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
[Code]....
Line 8: <configuration>
Line 9: <system.web>
Line 10: <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
Line 11: </system.web>
Line 12:
Source File: e:homeuysoftWebweb.config Line: 10
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.4028
View 7 Replies
May 11, 2010
I have a user control which encapsulates a NumericUpDownExtender. This UserControl implements the interface ICallbackEventHandler, because I want that when a user changes the value of the textbox associated a custom event to be raised in the server. By the other hand each time an async postback is done I shoe a message of loading and disable the whole screen. This works perfect when something is changed in for example an UpdatePanel through this lines of code:
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(
function (sender, args) {
var modalPopupBehavior = $find('programmaticSavingLoadingModalPopupBehavior');
modalPopupBehavior.show();
}
);
The UserControl is placed inside a detailsview which is inside an UpdatePanel in an aspx. When the custom event is raised I want another textbox in the aspx to change its value. So far, When I click on the UpDownExtender, it goes correctly to the server and raises the custom event, and the new value of the textbox is assigned in the server. but it is not changed in the browser.
I suspect that the problem is the callback, since I have the same architecture for a UserControl with an AutoCompleteExtender which implement IPostbackEventHandler and it works. Any clues how can I solve this here to make the UpDownNumericExtender user control to work like the AutComplete one? This is the code of the user control and the parent:
using System;
using System.Web.UI;
using System.ComponentModel;
using System.Text;
namespace Corp.UserControls
{
[Themeable(true)]
public partial class CustomNumericUpDown : CorpNumericUpDown, ICallbackEventHandler
{
protected void Page_PreRender(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
currentInstanceNumber = CorpAjaxControlToolkitUserControl.getNextInstanceNumber();
}
registerControl(this.HFNumericUpDown.ClientID, currentInstanceNumber);
string strCallServer = "NumericUpDownCallServer" + currentInstanceNumber.ToString();
// If this function is not written the callback to get the disponibilidadCliente doesn't work
if (!Page.ClientScript.IsClientScriptBlockRegistered("ReceiveServerDataNumericUpDown"))
{
StringBuilder str = new StringBuilder();
str.Append("function ReceiveServerDataNumericUpDown(arg, context) {}").AppendLine();
Page.ClientScript.RegisterClientScriptBlock(typeof(CorpNumericUpDown),
"ReceiveServerDataNumericUpDown", str.ToString(), true);
}
nudeNumericUpDownExtender.BehaviorID = "NumericUpDownEx" + currentInstanceNumber.ToString();
ClientScriptManager cm = Page.ClientScript;
String cbReference = cm.GetCallbackEventReference(this, "arg", "ReceiveServerDataNumericUpDown", "");
String callbackScript = "function " + strCallServer + "(arg, context)" + Environment.NewLine + "{" + Environment.NewLine + cbReference + ";" + Environment.NewLine + "}" + Environment.NewLine;
cm.RegisterClientScriptBlock(typeof(CustomNumericUpDown), strCallServer, callbackScript, true);
base.Page_PreRender(sender,e);
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.Bindable(true)]
public Int64 Value
{
get { return (string.IsNullOrEmpty(HFNumericUpDown.Value) ? Int64.Parse("1") : Int64.Parse(HFNumericUpDown.Value)); }
set
{
HFNumericUpDown.Value = value.ToString();
//txtAutoCompleteCliente_AutoCompleteExtender.ContextKey = value.ToString();
// TODO: Change the text of the textbox
}
}
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.Bindable(true)]
[Description("The text of the numeric up down")]
public string Text
{
get { return txtNumericUpDown.Text; }
set { txtNumericUpDown.Text = value; }
}
public delegate void NumericUpDownChangedHandler(object sender, NumericUpDownChangedArgs e);
public event NumericUpDownChangedHandler numericUpDownEvent;
[System.ComponentModel.Browsable(true)]
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.Description("Raised after the number has been increased or decreased")]
protected virtual void OnNumericUpDownEvent(object sender, NumericUpDownChangedArgs e)
{
if (numericUpDownEvent != null) //check to see if anyone has attached to the event
numericUpDownEvent(this, e);
}
#region ICallbackEventHandler Members
public string GetCallbackResult()
{
return "";//throw new NotImplementedException();
}
public void RaiseCallbackEvent(string eventArgument)
{
NumericUpDownChangedArgs nudca = new NumericUpDownChangedArgs(long.Parse(eventArgument));
OnNumericUpDownEvent(this, nudca);
}
#endregion
}
/// <summary>
/// Class that adds the prestamoList to the event
/// </summary>
public class NumericUpDownChangedArgs : System.EventArgs
{
/// <summary>
/// The current selected value.
/// </summary>
public long Value { get; private set; }
public NumericUpDownChangedArgs(long value)
{
Value = value;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Corp
{
/// <summary>
/// Summary description for CorpAjaxControlToolkitUserControl
/// </summary>
public class CorpNumericUpDown : CorpAjaxControlToolkitUserControl
{
private Int16 _currentInstanceNumber; // This variable hold the instanceNumber assignated at first place.
public short currentInstanceNumber
get { return _currentInstanceNumber; }
set { _currentInstanceNumber = value; }
}
protected void Page_PreRender(object sender, EventArgs e)
{
const string strOnChange = "OnChange";
const string strCallServer = "NumericUpDownCallServer";
StringBuilder str = new StringBuilder();
foreach (KeyValuePair<String, Int16> control in controlsToRegister)
{
str.Append("function ").Append(strOnChange + control.Value).Append("(sender, eventArgs) ").AppendLine();
Append("{").AppendLine();
str.Append(" if (sender) {").AppendLine();
str.Append(" var hfield = document.getElementById('").Append(control.Key).Append("');").AppendLine();
str.Append(" if (hfield.value != eventArgs) {").AppendLine();
str.Append(" hfield.value = eventArgs;").AppendLine();
str.Append(" ").Append(strCallServer + control.Value).Append("(eventArgs, eventArgs);").AppendLine();
str.Append(" }").AppendLine();
str.Append(" }").AppendLine();
str.Append("}").AppendLine();
Page.ClientScript.RegisterClientScriptBlock(typeof(CorpNumericUpDown), Guid.NewGuid().ToString(), str.ToString(), true);
}
str = new StringBuilder();
foreach (KeyValuePair<String, Int16> control in controlsToRegister)
{
str.Append(" funcsPageLoad[funcsPageLoad.length] = function() { $find('NumericUpDownEx" + control.Value + "').add_currentChanged(").Append(strOnChange + control.Value).Append(");};").AppendLine();
str.Append(" funcsPageUnLoad[funcsPageUnLoad.length] = function() { $find('NumericUpDownEx" + control.Value + "').remove_currentChanged(").Append(strOnChange + control.Value).Append(");};").AppendLine();
}
Page.ClientScript.RegisterClientScriptBlock(typeof(CorpNumericUpDown), Guid.NewGuid().ToString(), str.ToString(), true);
}
}
}
and to create the loading view I use this: //The beginRequest event is raised before the processing of an asynchronous postback starts and the postback is sent to the server. You can use this event to call custom script to set a request header or to start an animation that notifies the user that the postback is being processed.
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(
function (sender, args) {
var modalPopupBehavior = $find('programmaticSavingLoadingModalPopupBehavior');
modalPopupBehavior.show();
}
);
//The endRequest event is raised after an asynchronous postback is finished and control has been returned to the browser. You can use this event to provide a notification to users or to log errors.
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(
function (sender, arg) {
var modalPopupBehavior = $find('programmaticSavingLoadingModalPopupBehavior');
modalPopupBehavior.hide();
}
);
View 1 Replies
Jul 2, 2010
In Key Press Event i have put the logic of search in textbox, when i press enter key it will take the values from textbox and brings the data in DataGrid.
In another event of GotFocus there is an logic of autocompletestring collection from Table. If i type a in that textbox it will shows all the suggested string in that.
If i comment the logic of GotFocus Event for textbox for autocomplete then only then Key Press events work else its not working. I dont know why its happening.
So GotFocus loic creates the problem.
[Code]....
View 1 Replies
Apr 27, 2010
I have a .aspx page in c#. There is an ajax control that shows the data company names from the xml file when the city is selected.
There is also a bing search control on the page.
The issue is that the Ajax control stops populating the data when the search control is present on the page.
The ajax control works absolutely fine when the search control is removed
View 5 Replies
Apr 13, 2010
I have implemented AutoComplete Ajax control inside EO.Web Grid Control similar to this one:
[URL]
I have this this code:
[Code]....
The good news: It is working successfully !
The bad news...
I am facing the following problem.
When the AutoComplete Ajax Control gives the Popup Box after typing few characters in the "CustomColumn" input, and if the grid row is near the bottom of the grid, the popup box will be truncated, or it will not be shown at all. This is becuase the height of the popup is bypassing the bottom edge of the EO.Web Grid Control.
I am sure this can be solved by styling AutoComplete Control. I tried to change the style, and it is now completely messed up.
How I can ensure the the AutoComplete Popup Box will be visible even if it is near the bottom of the grid ?
View 3 Replies
Sep 29, 2010
I'm creating just simple autocomplete sample.
taking one textbox adding autocomplete extender as
<asp:ScriptManager ID="ScriptManager2" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
</Services>
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server" EnableTheming="True" ></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1" ServiceMethod="GetCountryInfo" ServicePath="WebService.asmx" TargetControlID="TextBox1">
</cc1:AutoCompleteExtender>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
Also creating web services as "WebService.asmx" & code inside this file is that
<%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" %>
------
then in Webservice.cs file i write code as
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;
}
this code is not working
View 1 Replies
Jul 8, 2010
My AJAX autocomplete control is not working. I have tried everything I can think of.
[Code]....
View 11 Replies
Dec 11, 2010
have a problem with my autocomplete control over a textbox here is the code in .aspx file
[Code]....
and the webservice1.asmx code
[Code]....
when i run the project in browser ant start typing nothing happens
View 6 Replies
Jun 8, 2010
i have written some code to for a project im working on but the Ajax tool doesnt want to function.... I know the web method works course it gives me my results when i run it but when i run the appliaction the AJAX doesnt fire this is my web service code
[WebMethod]
public string[] GetCompletionList(string text)
{
List<string> al = new List<string>(10);
[code]...
View 10 Replies
Dec 17, 2010
I want to use the all the default functionalities of autocomplete control from toolkit, also want to customise it.For e.g. i want to add few more properties to it or customise the servicemethod parameters.Is there any way to do it?
View 3 Replies
Aug 25, 2010
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
[code]...
View 5 Replies
Mar 5, 2011
I can't get AJAX CT Autocomplete to work. The problem is when I start writing in textbox nothing happens. The frist problem I had experienced was when I tried to Add AutoComplete page method I got an error: "Cannot create page method "GetCompletionList"...". Then I tried creating it manually, but still nothing happens.
Here is the AdministracijaOsoba.aspx code:
[Code]....
Here is the AdministracijaOsoba.aspx.cs code:
[Code]....
Take a note that I'm using LINQ to Entities.
View 4 Replies
Jun 23, 2010
When setting Percentages sizes on the textbox that I'm using as target for the Autocomplete it changes it's width when loosing or obtaining focus.
I Fixed this by setting the size in pixels instead.
Is this a bug or was I doing something wrong?
View 1 Replies
Feb 18, 2010
I have hooked up a textbox to an autocomplete extender control and it seems to work fine with me restricting what is displayed as the user types via a web method in the code behind. I am using the CreateAutoCompleteItem key value pairs method. I have also created an OnClientItemSelected event which can update the value of a hidden field.The problem I have is when the user might want to retrieve a record and I want the textbox to display the correct value when the page loads. If possible making my textbox have key value pairs, etc.
View 1 Replies
May 17, 2010
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
[Code]....
View 1 Replies
Mar 3, 2011
Having a problem with autocomplete I put autocomplete control with textbox For data to be retrieved from database, I am putting .asmx file and .cs file for that Now I am giving .asmx file path in autocomplete. asmx file contains path for .cs file If this is the situation, autocomplete dont work and in .cs file , event is not fired.
But if i put that event from .cs file directly into the codebehing file of that control, then it works ok
How can i call an event in .cs file that is placed inside a app_code folder seperately from .aspx and .cs file of the autocomplete control
View 1 Replies
May 20, 2010
how can change target control ID of an autocomplete Extender without refreshing page or using update panel
exactly with ajax!!!
and how can add an new instance of server controls like Ajax control toolkit or Standard controls like TextBox,Button,..
View 1 Replies
May 23, 2013
I followed below article [URL] .....
But I want to pass the value which i stored in my "int ID" Â instead of dropdown selected, I am getting this error "Newline in constant"
function SetContextKey()
{
$find('<%=AutoCompleteExtender1.ClientID>%').set_contextKey($get("<%=ID.ClientID %>").value);
}
View 1 Replies
Sep 16, 2010
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.
[Code]....
WEB SERVICE:
[Code]....
View 7 Replies
Jan 11, 2011
I specially has used hotmail and I like its autocomplete for To Address. It works very nice like it not only shows saved contacts but also suggests address on which I have sent email but they are not saved in contacts.
The most important thing is it is very fast. It is not ajaxtoolkit's automcplete what is this control.
View 1 Replies