I have a panel that I want to act as an extension of ValidationSumma ry. Some fields are simply too complex for a RegEx to analyse, so I check them on a button click event and pass error messages to a Label contained in the aforementioned Panel.
Trouble is, the Panel doesn't unhide! A rougher alternative I tried, if (!IsPostBack), doesn't work either.
[code=html]
<form id="Form1" method="POST" action="" runat="server">
<div style="width:10 0%">
<asp:Validation Summary ID="ValidationS ummary1" CssClass="error Message" runat="server" ForeColor="Blac k" />
</div>
<div style="width:10 0%">
<asp:Panel ID="customValid ationSummary" runat="server" CssClass="error Message">
<asp:Label ID="msg" runat="server" />
</asp:Panel>
</div>[/code]
[code=cpp]
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[/code]
Trouble is, the Panel doesn't unhide! A rougher alternative I tried, if (!IsPostBack), doesn't work either.
[code=html]
<form id="Form1" method="POST" action="" runat="server">
<div style="width:10 0%">
<asp:Validation Summary ID="ValidationS ummary1" CssClass="error Message" runat="server" ForeColor="Blac k" />
</div>
<div style="width:10 0%">
<asp:Panel ID="customValid ationSummary" runat="server" CssClass="error Message">
<asp:Label ID="msg" runat="server" />
</asp:Panel>
</div>[/code]
[code=cpp]
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[/code]
Comment