Putting the cursor in text box after validating in ASP.NET
<p>I have a basic ASP.NET website which has a register page with the user name, password and email as text boxes. Only one of them, the email, has a validation which is the default email validation from ASP.NET.
After the validation, I want the cursor to be in the email textbox if the validation fails.
Currently the message is displayed but the cursor is not on the page.</p>

<pre><code>                                                &lt;tr&gt;
                                                &lt;td&gt;
                                                    &lt;asp:TextBox ID="txtPassword" runat="server" CssClass="cpTextBox" TextMode="Password"
                                                        TabIndex="7" ToolTip="Password must be at least six characters in length"&gt;&lt;/asp:TextBox&gt;
                                                    &lt;asp:RequiredFieldValidator ID="rfvPassword" runat="server" ControlToValidate="txtPassword"
                                                        ErrorMessage="Please enter password" Display="None"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                                                    &lt;asp:RegularExpressionValidator ID="revPassword" runat="server" ControlToValidate="txtPassword"
                                                        ErrorMessage="Password must be at least six characters in length" ValidationExpression=".{6,50}"
                                                        Display="None"&gt;*&lt;/asp:RegularExpressionValidator&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;asp:TextBox ID="txtTitle" runat="server" CssClass="cpTextBox" TabIndex="11"&gt;&lt;/asp:TextBox&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    &lt;asp:Label ID="lblVerifyPassword" runat="server" CssClass="cpLabel" Text="Verify password"&gt;&lt;/asp:Label&gt;
                                                    &lt;asp:Label ID="Label4" runat="server" ForeColor="Red" Text="*"&gt;&lt;/asp:Label&gt;
                                                &lt;/td&gt;
                                                &lt;td&gt;
                                                    &lt;asp:Label ID="lblPhone" runat="server" CssClass="cpLabel" Text="Phone"&gt;&lt;/asp:Label&gt;
                                                &lt;/td&gt;
                                            &lt;/tr&gt;
                                            &lt;tr&gt;
                                                &lt;td&gt;
                                                    &lt;asp:TextBox ID="txtVerifyPassword" runat="server" CssClass="cpTextBox" TextMode="Password"
                                                        TabIndex="8"&gt;&lt;/asp:TextBox&gt;
                                                    &lt;asp:RequiredFieldValidator ID="rfvConfirmPassword" runat="server" ControlToValidate="txtVerifyPassword"
                                                        ErrorMessage="Please verify the password" Display="None"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                                                    &lt;asp:CompareValidator ID="cvVerifyPassword" runat="server" ControlToCompare="txtPassword"
                                                        ControlToValidate="txtVerifyPassword" ErrorMessage="Please verify the password"
                                                        Display="None"&gt;*&lt;/asp:CompareValidator&gt;
                                                &lt;/td&gt;
</code></pre>

<p>Can someone guide me on how to do this?</p>

<p>Regards.</p>
