By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Changing RadioButton's NAme and ID properties using

P: n/a
I want to change my radiobutton's name ,id and value properties

RadioButton1.Attributes.Add("value", "Pele")

RadioButton1.Attributes.Add("name", "R1")

RadioButton1.Attributes.Add("id", "SAVAS")

It returns

<span name="R1" id="SAVAS" style="Z-INDEX: 101; LEFT: 8px; POSITION:
absolute; TOP: 8px"><input id="RadioButton1" type="radio"
name="RadioButton1" value="Pele" /></span>

My first Html code is like that

<asp:RadioButton id="RadioButton1" style="Z-INDEX: 101; LEFT: 8px; POSITION:
absolute; TOP: 8px"
Mar 24 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
RadioButton1.ID = "SAVAS"
In place of the value attribute, you can use the text attribute.
RadioButton1.Text = "Pele"
The name attribute is deprecated in the xhtml standard and it's role is
replaced by ID.


Mar 24 '06 #2

P: n/a
By the way the <span ...>...</span> html block is the client side code
- it's what you see when you look at the source of the browser side

The <asp:RadioButton ...></asp:RadioButton> code block is the server
side page - what you see in Visual Studio source view.

The ASP.NET framework would render the server tags at runtime to
specific html tags that is suitable for the browser on the client
making the http request (adaptive rendering).


Mar 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.