|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DropDownList SelectedIndexChangedI've created a User control, where it has a DropDownList and a Textbox. Whenever the selectedindex is changed, the textbox will show the SelectedValue of the dropdownlist. Code in the ascx file private void InitializeComponent() { this.cboCode.SelectedIndexChanged += new System.EventHandler(this.cboCode_SelectedIndexChanged); this.ID = "cboCode"; this.Load += new System.EventHandler(this.Page_Load); } public void cboCode_SelectedIndexChanged(object sender, System.EventArgs eCboCode_SelectedIndexChanged) { txtDesc.Text = cboCode.SelectedValue; } When I include this control in the web form, is there any handling method I have to include to make the dropdownlist event fire? Currently, there is nothing shown on the textbox when the selectedindex changes. Any help will be appreciated. Thank You. Regards, Janet > When I include this control in the web form, is there any handling method Is the form being posted back to the server?> I have to include to make the dropdownlist event fire? Currently, there > is nothing shown on the textbox when the selectedindex changes. You may want to set AutoPostback='true' for the DDL. -- Happy Hacking, Gaurav Vaish | http://www.mastergaurav.com http://www.edujinionline.com http://articles.edujinionline.com/webservices -------------------
Control events - page life-cycle
ASP.NET 2.0 / GridView / ObjectDataSource / Update / Missing Columns The parameter is not correct from SqlDataAdapter control Controls calling other controls problem - ASP.NET 2.0 ASP code ASP.Net 2.0 DropDownList Selected Not Working... How to keep state of treeview control ASP.NET report viewer chart control dual axis support Gridview - disappearing data when column is hidden Custom Control inside <page>.aspx.cs |
|||||||||||||||||||||||