Cita:
<head>
<script language="vb" runat="server">
dim valor1 as string
dim valor2 as string
Sub Page_Load(sender1 as Object, e1 as EventArgs)
If Not IsPostBack
response.Write(valor1)
response.Write(valor2)
end if
end sub
SUB EVENTO1(Sender As Object, E As EventArgs)
if MASCULINO.checked then
valor1=1
end if
end sub
SUB EVENTO2(Sender As Object, E As EventArgs)
if FEMENINO.checked then
valor1=2
end if
end sub
SUB EVENTO3(Sender As Object, E As EventArgs)
if DIEZ.checked then
valor2=1
end if
end sub
SUB EVENTO4(Sender As Object, E As EventArgs)
if VEINTE.checked then
valor2=2
end if
end sub
</script>
<body>
<FORM RUNAT=SERVER>
SEXO:<BR>
<ASP:RADIOBUTTON TEXT=MASCULINO ID=MASCULINO GROUPNAME=GRUPO1 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO1" />
<ASP:RADIOBUTTON TEXT=FEMENINO ID=FEMENINO GROUPNAME=GRUPO1 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO2" /><BR>
<ASP:RADIOBUTTON TEXT=0-10 ID=DIEZ GROUPNAME=GRUPO2 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO3" />
<ASP:RADIOBUTTON TEXT=10-20 ID=VEINTE GROUPNAME=GRUPO2 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO4" /><BR>
<ASP:BUTTON ONCLICK=EVENTO1 TEXT=OK RUNAT=SERVER AutoPostBack="true" /><BR>
<ASP:LABEL ID=SEXO RUNAT=SERVER /><BR>
<ASP:LABEL ID=EDAD RUNAT=SERVER /><BR>
</FORM>
</body>
</html>
se supone q lo q kiero es q se mande valor1 y valor2 q se puedan mantener cuando se cambie d si y no .... y asi saber si tendra valores 1 o2 ..... para asi poder insertarlo en la base d datos <head>
<script language="vb" runat="server">
dim valor1 as string
dim valor2 as string
Sub Page_Load(sender1 as Object, e1 as EventArgs)
If Not IsPostBack
response.Write(valor1)
response.Write(valor2)
end if
end sub
SUB EVENTO1(Sender As Object, E As EventArgs)
if MASCULINO.checked then
valor1=1
end if
end sub
SUB EVENTO2(Sender As Object, E As EventArgs)
if FEMENINO.checked then
valor1=2
end if
end sub
SUB EVENTO3(Sender As Object, E As EventArgs)
if DIEZ.checked then
valor2=1
end if
end sub
SUB EVENTO4(Sender As Object, E As EventArgs)
if VEINTE.checked then
valor2=2
end if
end sub
</script>
<body>
<FORM RUNAT=SERVER>
SEXO:<BR>
<ASP:RADIOBUTTON TEXT=MASCULINO ID=MASCULINO GROUPNAME=GRUPO1 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO1" />
<ASP:RADIOBUTTON TEXT=FEMENINO ID=FEMENINO GROUPNAME=GRUPO1 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO2" /><BR>
<ASP:RADIOBUTTON TEXT=0-10 ID=DIEZ GROUPNAME=GRUPO2 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO3" />
<ASP:RADIOBUTTON TEXT=10-20 ID=VEINTE GROUPNAME=GRUPO2 RUNAT=SERVER AutoPostBack="true" OnCheckedChanged="EVENTO4" /><BR>
<ASP:BUTTON ONCLICK=EVENTO1 TEXT=OK RUNAT=SERVER AutoPostBack="true" /><BR>
<ASP:LABEL ID=SEXO RUNAT=SERVER /><BR>
<ASP:LABEL ID=EDAD RUNAT=SERVER /><BR>
</FORM>
</body>
</html>