Ciao a tutti ho poca familiarità con ASP.Net e C# io ho uno script di questo tipo:
<html>
<head>
<script language="C#" runat="server">
void Submit1_Click(object sender, EventArgs e)
{
if (Txt1.Visible==true)
{
Txt1.Visible=false;
OnOff1.Value="Mostra il testo Rosso";
}
else
{
Txt1.Visible=true;
OnOff1.Value="Nascondi il testo Rosso";
}
}
void Submit2_Click(Object sender, EventArgs e)
{
if (Txt2.Visible==true)
{
Txt2.Visible=false;
OnOff2.Value="Mostra il testo Blu";
}
else
{
Txt2.Visible=true;
OnOff2.Value="Nascondi il test Blu";
}
}
</script>
</head>
<body>
<h3><font face="Verdana">Html GenericControl - Esempio</font></h3>
<form runat="server">
Clicca su un bottone per nascondere o mostrare un testo:
<div id="Txt1" runat="server"><h1>
<font color="#ff0000">Rosso</font>
</h1></div>
<div id="Txt2" runat="server"><h1>
<font color="0000ff">Blu</font>
</h1></div>
<input type="submit" runat="server" id="OnOff1" Value="Nascondi il testo Rosso" OnServerClick="Submit1_Click">
<input type="submit" runat="server" id="OnOff2" Value="Nascondi il testo Blu" OnServerClick="Submit2_Click">
</form>
</body>
</html>
------------------------
Scusate l'esempio scolastico ma sto studiando![]()
Volevo sapere è possibile richiamare lo script in C# attraverso un semplice link, un pò come avviene per javascript <a href='javascript:funzione()'>???
Ciao e grazie a tutti quelli che mi daranno una mano...
![]()

Rispondi quotando