View Single Post
  #3 (permalink)  
Old March 3rd, 2009, 10:36 AM
Will Will is offline
Friend of Wrox
Join Date: Feb 2009
Posts: 194
Thanks: 5
Thanked 3 Times in 3 Posts

I do have the div set to runat="server" already but it throws an exception.

And I just figured out why...It think. because the lblSuccess was in the div contact1 so maybe it was because it didn't know whether to display it or hide it?

However after moving lblSuccess out of the div I am now incurring a parser error to do with the ContentTemplate, so hopefully if I fix that then it should work as intended.

Anyway the code I have in my page is:

<!--**************Contact Form*****************-->
             <asp:ScriptManager runat="server"></asp:ScriptManager>
             <asp:UpdatePanel runat="server">
                                                         <div id="contact1" runat="server">
                                                         <asp:label runat="server" ID="lblName" Text="Name:" />
        <asp:TextBox runat="server" ID="txtName" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter a name." ControlToValidate="txtName" CssClass="error">*</asp:RequiredFieldValidator>
        <asp:Label runat="server" ID="lblEmail" Text="Email:" />
        <asp:TextBox runat="server" ID="txtEmail" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ErrorMessage="Please enter an email address." ControlToValidate="txtEmail" CssClass="error">*</asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ErrorMessage="Please enter a valid email address, eg:" ControlToValidate="txtEmail" CssClass="error" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
               <asp:Label runat="server" id="lblSubject" text="Subject:"></asp:Label> 
               <asp:TextBox runat="server" id="txtSubject" />
              <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Please enter a subject" ControlToValidate="txtSubject" CssClass="error">*</asp:RequiredFieldValidator>
        <asp:Label runat="server" ID="lblMessage" Text="Message:" />
        <asp:TextBox runat="server" ID="txtMessage" TextMode="MultiLine" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please enter a message" ControlToValidate="txtMessage" CssClass="error">*</asp:RequiredFieldValidator>
            <asp:Button runat="server" ID="btnSubmit" Text="Submit Form!" CssClass="submit" />
              <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Please correct the following errors:" />
                   <asp:UpdateProgress runat="server">
              <div class="pleasewait">
              <p>Please Wait...</p>
              <asp:Label ID="lblSuccess" runat="server" Visible="false">Your message has been sent successfully.</asp:Label>
         <!--**************END of Contact Form****************-->
and the error message I am getting is:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Unexpected end of file looking for </ContentTemplate> tag.

Source Error:

Line 19: <asp:ScriptManager runat="server"></asp:ScriptManager>
Line 20: <asp:UpdatePanel runat="server">
Line 21: <ContentTemplate>
Line 22:
Line 23: <div id="contact1" runat="server">
any ideas?
Reply With Quote