Inline coding model in asp.net

Inline coding model
This is an example of asp.net InLine coding model. First create a web form name InLineCodingModel.aspx and put two Label control, a TextBox control and a Button control. When someone clicks the Button he can see his inputted value in Label control. The business logic is placed between script tags in this web form. The source code of InLineCodingModel.aspx is here.
InlineCodingModel.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e) {
        Label1.Text = "Your City Name Is : " +
            TextBox1.Text.ToString();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ASP.NET inline coding model example</title>
</head>
<body style="padding:25px">
    <form id="form1" runat="server">
    <div>
        <h2 style="color:MidnightBlue; font-style:italic;">      
            Inline coding model example
        </h2>      
        <hr width="450" align="left" color="Gainsboro" />
        <asp:Label 
            ID="Label1" 
            runat="server" 
            Font-Size="Larger" 
            ForeColor="Crimson"
            Font-Italic="true"
            Font-Names="Comic Sans MS"
            />
        <br /><br />
        <asp:Label 
            ID="Label2" 
            runat="server" 
            Text="Your City" 
            AssociatedControlID="TextBox1"
            Font-Bold="true"
            ForeColor="OliveDrab"
            />
        <asp:TextBox 
            ID="TextBox1" 
            runat="server"
             BackColor="Pink"
             Font-Bold="true"
            />
        <br /><br />
        <asp:Button 
            ID="Button1" 
            runat="server" 
            Text="Submit City" 
            OnClick="Button1_Click"
            Font-Bold="true"
            Height="45"
            />
    </div>
    </form>
</body>
</html>
More asp.net examples