RadioButton rd = new RadioButton();
rd.ID = "Radio1";
rd.Value = "YES";
rd.Text = "AJB";
rd.Attributes.Add("onclick", " javascript:toggle('YES',
'radGrantAllPermissions')");
If you have a panel, or table or a placeholder on your page, then you
can add this to that control as follows:
Pnl.Controls.Add(rd);
If ever you need to access this control, at any other place, then use
the ID as follows:
RadioButton rd1 = (RadioButton) (this.FindControl("Radio1"));
Using rd1 you can access all the properties of the above radiobutton.
But since you are adding the radio button dynamically, you need to
create it everytime in the page_load once created.
Rajendra.
-----Original Message-----
From: Burak Gunay [mailto:[EMAIL PROTECTED]
Sent: Monday, September 27, 2004 4:27 PM
To: [EMAIL PROTECTED]
Subject: [AspNetAnyQuestionIsOk] How do you access a dynamically cretaed
control's values on the server side?
Hello,
I would like to dynamically create a radio button by
assigning this string to a label or a literal
<input type="radio" name="AJB" value="YES"
onClick="javascript:toggle('YES','radGrantAllPermissions');"
runat="server" id="Radio1">
How would I then access this control on the server
side?
Thank you,
Burak
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
Yahoo! Groups Sponsor
ADVERTISEMENT
click here
<http://us.ard.yahoo.com/SIG=1294p23fn/M=295196.4901138.6071305.3001176/
D=groups/S=1705006764:HM/EXP=1096404821/A=2128215/R=0/SIG=10se96mf6/*htt
p:/companion.yahoo.com>
<http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=group
s/S=:HM/A=2128215/rand=787250526>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
cribe>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/