Login page error message
<p>I am using ASP.NET to create a Registration form.As part of my studies i have just created a Login page that include a username field and a password field.Now i would like to know How to display an error message/alert when a user fails to enter his/her username/password???. while clicking the Login button if any of the username or password field is empty, there should be an alert showing error.Thanks ...</p>

<p>here is what i have done yet... What all i have to do to show an alert box??? </p>

<pre><code>&lt;form id="form1" runat="server"&gt;
&lt;table class="style1"&gt;
    &lt;tr&gt;
        &lt;td class="style5"&gt;
        &lt;/td&gt;
        &lt;td class="style4"&gt;
        &lt;/td&gt;
        &lt;td class="style3"&gt;
        &lt;/td&gt;
        &lt;td class="style3"&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td class="style6"&gt;
            &amp;nbsp;&lt;/td&gt;
        &lt;td align="right" class="style2"&gt;
            &lt;asp:Label ID="Label1" runat="server" Text="Username *"&gt;&lt;/asp:Label&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &lt;asp:TextBox ID="TextBox1" runat="server" Width="180px"&gt;&lt;/asp:TextBox&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td class="style6"&gt;
            &amp;nbsp;&lt;/td&gt;
        &lt;td align="right" class="style2"&gt;
            &lt;asp:Label ID="Label2" runat="server" Text="Password *"&gt;&lt;/asp:Label&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &lt;asp:TextBox ID="TextBox2" runat="server" TextMode="Password" Width="180px"&gt;&lt;/asp:TextBox&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td class="style6"&gt;
            &amp;nbsp;&lt;/td&gt;
        &lt;td class="style2"&gt;
            &amp;nbsp;&lt;/td&gt;
        &lt;td&gt;
            &lt;asp:Button ID="Button1" runat="server" Text="Click" Width="100px" /&gt;
        &lt;/td&gt;
        &lt;td&gt;
            &amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
</code></pre>
