C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Training   ASP.NET Web Hosting    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

Play Silverlight Games or Submit your Silverlight applications and earn 90% AdSense revenue.

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




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:     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
dotnetfreshersworld



Author: Sandeep H.    04 Dec 2008Member Level: SilverRating:     Points: 1

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


Author: saravanakumar    04 Dec 2008Member Level: GoldRating:     Points: 1

hi sandeep,

Check the behaviour ID of AutoCompleteExtender.

regards,
saravan



Author: Sandeep H.    04 Dec 2008Member Level: SilverRating:     Points: 0

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


Author: saravanakumar    04 Dec 2008Member Level: GoldRating:     Points: 0

au.BehaviorID="AutoCompleteEx"


Author: john jose    04 Dec 2008Member Level: SilverRating:     Points: 1

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



Author: Deepika Haridas    04 Dec 2008Member Level: DiamondRating:     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 Haridas
DNS MVM

Please Rate this Response if you found it useful

Blog - www.angeldeeps.blogspot.com
Community - www.dotnetspider.com/sites/303/-TECHIE-QUESTIONNAIRE.aspx



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