Preventing post back on selected item of RadioButtonList
-
Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?
-
Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?
I Never Look Behind wrote:
i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?
Upto my knowledge NO. Because radiobuttonlist will be rendered as individual HTML radio buttons. Once you made
AutoPostback
to true, ASP.NET will add a javascript function to this radio buttons for posting the form. So you won't be able to call your javascript function on radiobutton click to prevent page from posting. To do this I suggest use individual radio buttons. If you don't know the number of radio button's at design time, then put aContentPlaceHolder
and add radio button controls there with your custom javascript function to post data.
-
Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?
Yes Navneeth is right instead of using the radiobutton List you can use radio buttins with same name attribute. if you have written any javascript then doucment.getElementByName will return you all same name radiobuttons Now here you can make auotpost back property true or false to any radio button
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?
-
If you are adding individual radio buttons to RadioButtonList at run-time then, before adding a radio button, set its "AutoPostBack" property to 'TRUE' or 'FALSE' as per your requirement.
GOOD! Thanks.