Collindsouza
asked on
HTML Radio Button setting Onclick event
I have a repeater control with a HTML radio button in it..
<input id="rbSelected" type="radio" value='<%# DataBinder.Eval(Container. DataItem," ContactID" ) %>' runat="server" />
I need to add a onclick event so that i can handle this event code behind..
i tried adding something like this..
<input id="rbSelected" type="radio" value='<%# DataBinder.Eval(Container. DataItem," ContactID" ) %>' runat="server" onclick="rbSelected_Click" />
and in code behind i tried to handle this event..
protected void rbSelected_Click(object sender, EventArgs e)
{
}
but it doesnt work..
If there is'nt any onclick event.. is there any other way i could handle this code behind.. meaning when the user clicks on a radio button.. then capture that event code behind..
Please help !!!
<input id="rbSelected" type="radio" value='<%# DataBinder.Eval(Container.
I need to add a onclick event so that i can handle this event code behind..
i tried adding something like this..
<input id="rbSelected" type="radio" value='<%# DataBinder.Eval(Container.
and in code behind i tried to handle this event..
protected void rbSelected_Click(object sender, EventArgs e)
{
}
but it doesnt work..
If there is'nt any onclick event.. is there any other way i could handle this code behind.. meaning when the user clicks on a radio button.. then capture that event code behind..
Please help !!!
ASKER
Hi Justin,
Since this is a HTML Radio Button... there is no AutoPostback attribute :((
Since this is a HTML Radio Button... there is no AutoPostback attribute :((
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi justin,
Many Thanks !!! yes you are right.. the path that i'm taking is getting quite complicated.. Writing a javascript routine to cause a page post back seems the only way out..
However i'm binning my entire approach and i will re-do it using gridview.. It seems to be a more sensible solution to my problem..
Thanks for your help..
Collin
Many Thanks !!! yes you are right.. the path that i'm taking is getting quite complicated.. Writing a javascript routine to cause a page post back seems the only way out..
However i'm binning my entire approach and i will re-do it using gridview.. It seems to be a more sensible solution to my problem..
Thanks for your help..
Collin
You're welcome!
2. Create an OnSelectionChanged event handler for the button. (e.g. Double-clicking the radiobutton in VS.NET should add an empty handler for you to customize.