0
<%@ Page Title="" Language="C#" MasterPageFile="~/MyMaster.Master" AutoEventWireup="true" CodeBehind="UserRegistration.aspx.cs" Inherits="MyProject.UserRegistration" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
                        <!-- Begin Slider -->
                        <div id="slider">
                            <div class="slider-frame"> </div>
                            <ul class="slider-items">
                                <li><img src="Styles/css/images/slide1.jpg" alt="Slide 1" /></li>
                                <li><img src="Styles/css/images/slide1.jpg" alt="Slide 1" /></li>
                                <li><img src="Styles/css/images/slide1.jpg" alt="Slide 1" /></li>
                                <li><img src="Styles/css/images/slide1.jpg" alt="Slide 1" /></li>
                                <li><img src="Styles/css/images/slide1.jpg" alt="Slide 1" /></li>
                            </ul>
                            <div class="cl"> </div>
                            <div class="slider-controls">
                                <ul></ul>
                                <div class="cl"> </div>
                            </div>
                        </div>

<form id="form1" runat="server">----removed-----------

                    <table align="center" border="1" cellpadding="1" cellspacing="1" class="Table" 
                        style="width: 60%">
                        <tr align="center">
                            <td align="left" width="1024">
                                <fieldset>
                                    <legend class="style5"><strong><em>Registration Page</em></strong></legend>
                                    <table class="style2">
                                        <tr>
                                            <td class="style8">
                                                <strong>First Name:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtFN" runat="server" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                    ControlToValidate="txtFN" ErrorMessage="Please enter the first name..." 
                                                    ForeColor="Red">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>Last Name:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtLN" runat="server" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                                    ControlToValidate="txtLN" ErrorMessage="Plese enter last name..." 
                                                    ForeColor="Red">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>User Name:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtUN" runat="server" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                                    ControlToValidate="txtUN" ErrorMessage="Please enter the user name..." 
                                                    ForeColor="Red">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>Password:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtPass" runat="server" TextMode="Password" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                                    ControlToValidate="txtPass" ErrorMessage="Please enter the password..." 
                                                    ForeColor="Red">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>Confirm Password:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtCP" runat="server" TextMode="Password" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                                    ControlToCompare="txtCP" ControlToValidate="txtPass" 
                                                    ErrorMessage="Please re-enter the confirm password..." ForeColor="Red">Please enter the correct Password</asp:CompareValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>Gender:</strong></td>
                                            <td class="style4">
                                                <asp:RadioButtonList ID="rdlGender" runat="server">
                                                    <asp:ListItem>Male</asp:ListItem>
                                                    <asp:ListItem>Female</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                                    ControlToValidate="rdlGender" ErrorMessage="Please enter the gender..." 
                                                    ForeColor="Red">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>Address:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtAdd" runat="server" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                                    ControlToValidate="txtAdd" ErrorMessage="Please enter the address..." 
                                                    ForeColor="Red" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style8">
                                                <strong>Email ID:</strong></td>
                                            <td class="style4">
                                                <asp:TextBox ID="txtEmail" runat="server" Width="180px"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:RequiredFieldValidator ID="EmailRequiredFieldValidator8" runat="server" 
                                                    ControlToValidate="txtEmail" ErrorMessage="Email address required" 
                                                    ForeColor="Red">*</asp:RequiredFieldValidator>
                                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                                    ControlToValidate="txtEmail" Display="Dynamic" 
                                                    ErrorMessage="Invalid email address" ForeColor="Red" SetFocusOnError="True" 
                                                    ValidationExpression="\w+([-+.']\w+)*@gmail.com">Please enter the valid GMail account</asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style7" colspan="3">
                                                <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" 
                                                    Text="Sign Up" />
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset></td>
                        </tr>
                    </table>

</form>---------removed-----------------

</div>


</asp:Content>

i already that i has a form tag in my master page i understabd that axp.net only allow a page can have only one server-side Form tag. After i removed the form tag in my page that link to master page it ocuurs the error Control 'ContentPlaceHolder1_txtFN' of type 'TextBox' must be placed inside a form tag with runat=server. Can everyone helps?

Edited by __avd: Move to ASP.NET

2
Contributors
1
Reply
7
Views
4 Years
Discussion Span
Last Post by LastMitch
0

After i removed the form tag in my page that link to master page it ocuurs the error Control 'ContentPlaceHolder1_txtFN' of type 'TextBox' must be placed inside a form tag with runat=server.

There should be only 1 form tag which is your master page.

There should be no runat="server" in your code excepted the master page.

I hope this is not 1 page.

I have a feeling that you put everything in 1 page because that error Control 'ContentPlaceHolder1_txtFN' of type 'TextBox' must be placed inside a form tag with runat=server.

It should be 2 pages.

1 form tag from master page and link to content page.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.