File Options Using Inline Coding File Created
Web Form .aspx file
Master Page .master file
Web User Control .ascx file
Web Service .asmx file
File: Default.aspx (VB)
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, _
ByVal e As System.EventArgs)
Label1.Text = "Hello " & Textbox1.Text
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Simple Page</title>
</head>
<body>
<form runat="server">
What is your name?<br />
<asp:Textbox ID="Textbox1" Runat="server"></asp:Textbox><br />
<asp:Button ID="Button1" Runat="server" Text="Submit"
OnClick="Button1_Click" />
<asp:Label ID="Label1" Runat="server"></asp:Label>
</form>
</body>
</html>
File: Default.aspx (C#)
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
Label1.Text = "Hello " + Textbox1.Text;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Simple Page</title>
</head>
<body>
<form runat="server">
What is your name?<br />
<asp:Textbox ID="Textbox1" Runat="server"></asp:Textbox><br />
<asp:Button ID="Button1" Runat="server" Text="Submit"
OnClick="Button1_Click" />
<asp:Label ID="Label1" Runat="server"></asp:Label>
</form>
</body>
</html>
|