Trouble is, the Panel doesn't unhide! A rougher alternative I tried, if (!IsPostBack), doesn't work either.
Expand|Select|Wrap|Line Numbers
- <form id="Form1" method="POST" action="" runat="server">
- <div style="width:100%">
- <asp:ValidationSummary ID="ValidationSummary1" CssClass="errorMessage" runat="server" ForeColor="Black" />
- </div>
- <div style="width:100%">
- <asp:Panel ID="customValidationSummary" runat="server" CssClass="errorMessage">
- <asp:Label ID="msg" runat="server" />
- </asp:Panel>
- </div>
Expand|Select|Wrap|Line Numbers
- protected void btnSubmit_Click(object sender, EventArgs e)
- {
- msg.Text = ValidateFields(); // currently set to do nothing but return an arbitrary nonempty string
- if (msg.Text == "")
- {
- // send data on its merry way
- }
- else
- {
- msg.Visible = true;
- }
- } // end function