M
Mr Not So Know It All
thanks for taking the time to review my request.
i have a user control with a radiobuttonlist. i would like to click on
one of the buttons and raise the event from the button and catch it
with page (eventually pass the event results to another user control).
i found an article on the web that demonstrated this, but i could get
it to work.
link to article -
http://www.openmymind.net/communication/index.html#3.3
here is my code. again, thanks for the help
page _________________________________________________
public class myRadioage
{
protected PlaceHolder plh_radioOne;
protected myRadioOne mROne = new myRadioOne();
void Page_Load(object s, EventArgs e)
{
mROne.myRadioChg += new myRadioOne.chgRadio(mROne_myRadioChg);
Control ctl = new Control();
ctl = LoadControl("myRadioOne.ascx");
plh_radioOne.Controls.Add(ctl);
}
void mROne_myRadioChg(object s, EventArgs e)
{
Response.Write("caught radio event");
//throw new Exception("The method or operation is not
implemented.");
}
}
usercontrol ___________________________________________
public class myRadioOne:UserControl
{
public delegate void chgRadio(object s, EventArgs e);
public event chgRadio myRadioChg;
public void chgValue(object s, EventArgs e)
{
RadioButtonList r = (RadioButtonList)s;
Response.Write("Selected Value : " + r.SelectedValue);
if(myRadioChg!=null)
{
myRadioChg(s, e);
}
}
}
again thanks for assistance. any help will be greatly appreciated.
i have a user control with a radiobuttonlist. i would like to click on
one of the buttons and raise the event from the button and catch it
with page (eventually pass the event results to another user control).
i found an article on the web that demonstrated this, but i could get
it to work.
link to article -
http://www.openmymind.net/communication/index.html#3.3
here is my code. again, thanks for the help
page _________________________________________________
public class myRadioage
{
protected PlaceHolder plh_radioOne;
protected myRadioOne mROne = new myRadioOne();
void Page_Load(object s, EventArgs e)
{
mROne.myRadioChg += new myRadioOne.chgRadio(mROne_myRadioChg);
Control ctl = new Control();
ctl = LoadControl("myRadioOne.ascx");
plh_radioOne.Controls.Add(ctl);
}
void mROne_myRadioChg(object s, EventArgs e)
{
Response.Write("caught radio event");
//throw new Exception("The method or operation is not
implemented.");
}
}
usercontrol ___________________________________________
public class myRadioOne:UserControl
{
public delegate void chgRadio(object s, EventArgs e);
public event chgRadio myRadioChg;
public void chgValue(object s, EventArgs e)
{
RadioButtonList r = (RadioButtonList)s;
Response.Write("Selected Value : " + r.SelectedValue);
if(myRadioChg!=null)
{
myRadioChg(s, e);
}
}
}
again thanks for assistance. any help will be greatly appreciated.