411 REFERENCE · Wikibooks
ASP.NET/Adding A Little Interactivity
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Either
<%@ Page Language="VB" %>
or
<%@ Page Language="C#" %>
Testing Interactivity
VB.Net code:
' ASP.NET page code goes here
Sub Page_Load()
'On Page Load Run this code
End Sub
Sub submit_Click()
output.Text = "'" & input.Text & "' (" & input.Text.Length & " characters)"
End Sub
C# code:
// ASP.NET page code goes here
void Page_Load(object sender, EventArgs e){
// On Page Load Run this code
}
void submit_Click(object sender, EventArgs e){
output.Text = "'" + input.Text + "' (" + input.Text.Length + " characters)";
}
<asp:textbox id="input" runat="server"/>
<asp:literal id="output" runat="server"/>
<asp:button id="submit" runat="server" text="show details" OnClick="submit_Click"/>