dynamic radio button text in page load

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.
 
B

bruce barker

__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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top