I would like to pass a reference of a webcontrol into a javascript
function. Below I have a snippet of code. "me.selectedVal ue" returns
undefined. I was hoping that would return the value that the user has
selected in the radio list..
ps: this is my first post, be gentle:)
**aspx page**
<form id="Form1" method="post" runat="server">
<asp:RadioButto nList ID=radio1 Runat=server >
<asp:ListItem Value=1 >Option 1</asp:ListItem>
<asp:ListItem Value=2 >Option 2</asp:ListItem>
<asp:ListItem Value=3 >Option 3</asp:ListItem>
</asp:RadioButton List>
</form>
**Code Behind**
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim strScript As String = "<script language=""Java Script"">" &
vbCrLf
strScript += " function test1(me) " & vbCrLf
strScript += "{alert(me.Sele ctedValue); " & vbCrLf
strScript += "}</script>"
If (Not Page.IsClientSc riptBlockRegist ered("clientScr ipt"))
Then
Page.RegisterCl ientScriptBlock ("clientScript" , strScript)
End If
End Sub
Private Sub Page_PreRender( ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.PreRende r
radio1.Attribut es.Add("onclick ", "test1(this )")
End Sub