ASP.Net RadioButton Text

Results 1 to 2 of 2

Thread: ASP.Net RadioButton Text

  1. #1
    Join Date
    Dec 1969

    Default ASP.Net RadioButton Text

    Hi,<BR><BR>Does anyone know how to set the text associated with a Web Form RadioButton using JavaScript?<BR><BR>I looked at the HTML that is generated by this control and the text associated with the RadioButton is generated as a &#060;label&#062; tag with a "for" property referencing the "id" of the RadioButton. This &#060;label&#062; tag has no "id" for itself though so I&#039;m no sure how to go about this.<BR><BR>Any help would be great!<BR><BR>Thanks...<BR>Pete

  2. #2
    Join Date
    Dec 1969

    Default RE: ASP.Net RadioButton Text

    Hmm, well the RadioButton is a server contol--hence manipulated at the server. Javascript is client side. Not sure you can do this. Are you wanting to avoid a trip back to the server or what is the reason for wanting to use Javascript instead of setting this in the code behind? You might looing into the Attributes.Add...<BR><BR>myRadioButton.Attributes. Add("onclick", "JavaScript: some command) etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts