B
bredal Jensen
Hello,
I have populated a web form with dynamically created radiobuttons in
a table. I wnat some of the radio buttons to fire events when their
..CheckChanged property has changed.
I understand and was told this can be done with events and delegates. But my
code would
not compile. Here is what i did.
public delegate void specialRadioEventHandler(object sender, EventArgs e);
....
....
....
private void BuildMyDialog()
{
//Dynamically creating my table . Function called in
page_Load(IsPostBack==false)
....
....
....
RadioButton rb = new RadioButton();
if (RadioMeetMycodnition)
{
rb.AutoPostBack = true;
rb.CheckedChanged+=new specialRadioEventHandler( DoSomething );
}
public voidDoSomething (object sender, EventArgs e)
{
//Only for testing purpose.
string teststring = "oi";
Response.Write(teststring);
}
.......
.......
.....
I'am i doing something wrong?
Thanks...
I have populated a web form with dynamically created radiobuttons in
a table. I wnat some of the radio buttons to fire events when their
..CheckChanged property has changed.
I understand and was told this can be done with events and delegates. But my
code would
not compile. Here is what i did.
public delegate void specialRadioEventHandler(object sender, EventArgs e);
....
....
....
private void BuildMyDialog()
{
//Dynamically creating my table . Function called in
page_Load(IsPostBack==false)
....
....
....
RadioButton rb = new RadioButton();
if (RadioMeetMycodnition)
{
rb.AutoPostBack = true;
rb.CheckedChanged+=new specialRadioEventHandler( DoSomething );
}
public voidDoSomething (object sender, EventArgs e)
{
//Only for testing purpose.
string teststring = "oi";
Response.Write(teststring);
}
.......
.......
.....
I'am i doing something wrong?
Thanks...