<%@Page Language="VB" %>
<script runat="server">
sub Submit_Click(Sender as Object,e as EventArgs)
if tbName.Value <>""
Session("Name ")=tbName.Value
Response.Write("Hi " & Session("Name ")&"!")
else
Response.Write("You forgot to enter a name.")
end if
end sub
</script>
<html>
<body>
<form runat="server">
Please enter your name:
<input type="text" id="tbName" runat="server"/>
<asp:Button id="btSubmit" text="Submit" runat="server" OnClick="Submit_Click" />
</form>
</body>
</html>
////////////////////////////
<%@ Page Language="VB" %>
<script runat="server">
sub Page_Load(Sender as Object,e as EventArgs)
Label1.Text ="Welcome back " & Session("Name ") & "!"
end sub
</script>
<html><body>
<form runat="server">
<asp:Label id="Label1" runat="server"/>
</form>
</body></html>
/////////////////////////////
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs e) {
Label1.Text = "Welcome back " + Session["Name"] + "!";
}
</script>
<html><body>
<form runat="server">
<asp:Label id="Label1" runat="server"/>
</form>
</body></html>
|