C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

I want to apply....


Posted Date: 04 Dec 2008      Posted By: Sandeep H.      Member Level: Silver     Points: 1   Responses: 7



I want to apply AJAX AutoCompletExtender to textbox which i have created dynamically..........how can i do this????


I have done that but its not working.......

AjaxControlToolkit.AutoCompleteExtender au = new AutoCompleteExtender();
TextBox tx1 = new TextBox();
tx1.ID = "State";
tx1.Text ="";

pnlMain.Controls.Add(tx1);
pnlMain.Controls.Add(new LiteralControl("   "));

au.ID = "autoajax";
au.TargetControlID = "State";
au.ServiceMethod = "GetState";
au.ServicePath = "~/WebService.asmx";
au.MinimumPrefixLength = 1;
au.CompletionInterval = 1;
au.EnableViewState = true;
au.DelimiterCharacters = ",";
au.EnableCaching = true;
au.FirstRowSelected = true;

pnlMain.Controls.Add(au);
pnlMain.Controls.Add(new LiteralControl("   "));





Responses

Author: greeny_1984    04 Dec 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 1

u need script manager for the code to work and make the textbox to runat server using tags runat="server"

Regards,
Greeny_1984

Rate this Response[Excellent/Good/Poor]
FRESHERS check this link
Need help from me join here



Author: Sandeep H.    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 1

Yes , Script manager is dere.....Actually dere is no error..but not working .....


Author: saravanakumar    04 Dec 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 1

hi sandeep,

Check the behaviour ID of AutoCompleteExtender.

regards,
saravan



Author: Sandeep H.    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 0

means??i didnt get u.... pls


Author: saravanakumar    04 Dec 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 0

au.BehaviorID="AutoCompleteEx"


Author: john jose    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 1

HI ,
FOR COME REFERENCE PLZ DEPENDS ON TECONTHENET.COM OR CODEGURU



Author: Deepika Haridas    04 Dec 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 5

Hi,

Try this out

protected override void CreateChildControls()
{
string webServicePath = “http://localhost/WebServices/SimpleWebService.asmx”;
try
{
Literal textboxLabel = new Literal();
textboxLabel.Text = “”Type the name of a Employee: “;
this.Controls.Add(textboxLabel);
//TextBox to extend with the AutoComplete AJAX behaviour. Note: this is a normal asp textbox
TextBox textbox = new TextBox();
textbox.Attributes.Add(“id”, “SelectEmployeeTextBox”);
this.Controls.Add(textbox);
//autocomplete AJAX behaviour
AutoCompleteExtender autoComplete = new AutoCompleteExtender();
autoComplete.MinimumPrefixLength = 1;
autoComplete.ServicePath = webServicePath;
autoComplete.ServiceMethod = “GetEmployees”;
autoComplete.TargetControlID = “SelectEmployeeTextBox”;
this.Controls.Add(autoComplete);
}
catch(Exception ex)
{
Literal errMsg = new Literal();
errMsg.Text = ex.Message;
this.Controls.Add(errMsg);
}
}


Regards,
deepika



Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : How to give pagination for gridview?
Previous : e-learning opensource in .net
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use