DropDownList SelectedIndexChanged

J

Janet

Hi,

I'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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top