1

just validating a web form and getting the following error Everting was working fine until line 34 when I compiled and got this errors. there are no errors on my IDE I have run a debug and cannot generate or see anything invalid

enter image description here

    <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Student Registration Form</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <h3>Student Form</h3>

            <table>
                <tr>
                    <td>First Name</td>
                    <td>
                        <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ErrorMessage="Enter your First Name" ControlToValidate="txtFirstName" ValidationGroup="Submit"></asp:RequiredFieldValidator>

                    </td>
                </tr>

                <tr>
                    <td>Last Name</td>
                    <td>
                        <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox></td>
                    <asp:RequiredFieldValidator ID="rfvTxtLastName" runat="server" ErrorMessage="please enter your surname" ControlToValidate=" txtLastName" ValidationGroup="submit"></asp:RequiredFieldValidator>
                </tr>
                <tr>
                    <td>Email</td>
                    <td>
                        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox></td>
                    <asp:RegularExpressionValidator ID="revtxtEmail" runat="server" ErrorMessage="invalid Email Format" ControlToValidate="txtEmail" ValidationGroup="submit" ValidationExpression="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"></asp:RegularExpressionValidator>
                </tr>

                <tr>
                    <td>Subjects Available</td>

                    <td>
                        <asp:ListBox ID="ltbSubjectsAvailable" runat="server"></asp:ListBox>
                    </td>
                </tr>
                <tr>
                    <td>Subjects Selected</td>

                    <td>
                        <asp:ListBox ID="ltbSubjectsSelected" runat="server"></asp:ListBox></td>

                </tr>
                <tr>
                    <td>Password</td>
                    <td>
                        <asp:TextBox ID="txtPassword" TextMode="Password" runat="server"></asp:TextBox></td>
                    <asp:RequiredFieldValidator ID="rfvTxtPassword" runat="server" ErrorMessage="Please enter password" ControlToValidate="txtPassword" ValidationGroup="Submit"></asp:RequiredFieldValidator>
                </tr>

                <tr>
                    <td>Confirm Password</td>
                    <td>
                        <asp:TextBox ID="txtPasswordChange" TextMode="Password" runat="server"></asp:TextBox></td>
                    <asp:CompareValidator ID="cpvChangePassword" runat="server" ErrorMessage="Passwords do not match" ControlToValidate=" textPasswordChange" ControlToCompare="txtPassword"></asp:CompareValidator>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" ValidationGroup="Submit" Text="Button" /></td>
                </tr>

            </table>


        </div>
    </form>
</body>
</html>
Jaz Bansal
  • 13
  • 1
  • 5
  • put the actual error text in the question, not a screenshot - makes it a pain to copy/paste. Besides the error message tells you one of the ways to fix the error. – user1666620 Oct 29 '15 at 11:45
  • first result on google for the error message http://stackoverflow.com/questions/31868803/error-invalid-option-6-for-langversion-must-be-iso-1-iso-2-3-4-5-or-defa – user1666620 Oct 29 '15 at 11:46

2 Answers2

0

maybe this is the solution: change the compiler version in the web.config

web config compiler version

Community
  • 1
  • 1
tire0011
  • 1,048
  • 1
  • 11
  • 22
0

If you see at the bottom of your error message

Asp.net version is 4.6 .net framework is 4.0

Make sure you're compiling in correct framework.

amit dayama
  • 3,246
  • 2
  • 17
  • 28
  • amit thank ... I believe is a bug issue as this code was original done in VS2013 and now being coded on VS2015 can you advise I have changed target framework: 4.6 language version to 6 still errors – Jaz Bansal Oct 29 '15 at 12:22
  • can you share compiler tag from your web.config? – amit dayama Oct 29 '15 at 12:40
  • thanks I have managed to sort this out, I created a new web.config file with the correct .net framework version – Jaz Bansal Oct 29 '15 at 16:22