Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
the table which i have created by using a class.
so please where should i place the code for those events.
and how the code can be written
please help me
Posted
Comments
Anup Das Gupta (asteranup) 27-Oct-11 3:06am    
Hi,

What kind of event you are talking about? Client side or server side event?
sandhya.T 2011 27-Oct-11 4:00am    
the drop down List default event
as "ddl1_SelectedIndexChanged" events and radio button as "RB_CheckedChanged" events
sandhya.T 2011 27-Oct-11 6:37am    
i just want to raise the events dynamically.
where should i place the events code or logic(i have created these web controls by using a class1.cs file)
now where should i place the code for them

1 solution

Your Question is not very clear. What I understood is - You have created dynamic DropDownList and RadioButton and now you want to assign some Event to it.

Try as below code to assign an Event to your dynamically created DropDownList.
C#
myDropdownList.SelectedIndexChanged += new EventHandler(myDropdownList_SelectedIndexChanged);
myDropdownList.AutoPostBack = true;

private void myDropdownList_SelectedIndexChanged(object sender, EventArgs e)
{
  //Write your Dropdown Selected Index Changed code here.

}


And try as below code to assign an Event to your dynamically created RadioButton.
C#
myRadioButton.CheckedChanged += new EventHandler(this.myRadioButton_CheckedChanged);
myDropdownList.AutoPostBack = true;

private void myRadioButton_CheckedChanged(object sender, System.EventArgs e)
{
  //Write your RadioButton Changed code here.

}


Hope this helps.
 
Share this answer
 
Comments
sandhya.T 2011 27-Oct-11 6:28am    
thanq so much
RaisKazi 27-Oct-11 7:00am    
Welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900