dynamic radio button text in page load

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
i am creating many radio RadioButtonList dynamically in page load.its
working find.now i want to select a text in radio button(Autopostback is true
for radio buttonlist) and find that text in page load using break point.i am
able to get control ID by using
string syscontrol = (string)Request.Form["__EVENTTARGET"];
how to find the selecte text.

please help me.i cannot do radiobuttonlist1.selecteditem.text because i am
creating control in page load only.
 
__EVENTARGET is filled in by javascript by an autopostback control when
it posts back. it is the name of the control. radio buttons only
postback their value (if selected), not text.

if you are dynamically creating controls, you should do it in on init.
in session (or viewstate) store enough info to recreate on postback.
then in page load you can just get the value.

-- bruce (sqlwork.com)
 
Back
Top