Quote:
Your browser has JavaScript disabled
|
I do use Noscript, but I leave JavaScript on
Quote:
"the web page blinks" seems to indicate that the client side behavior is not kicking in
|
Well I redid the code, but boy you have to be careful, because the controls are registered and I was getting build errors. So I deleted the control AND removed the registration for it in the Contact.aspx form markup. It doesn't do this when you delete the user control!
Well I put your control code in ContactForm.ascx and ContactForm.ascx.cs because mine was 'acting up' and I guess I didn't want to redo the whole form over again with the validation objects.
Well it still was not giving me a MessageBox. hmmmm. But the flicker was gone and the client side kicked in and gave me the JavaScript error inline message and the red asterisks.
So I went and made ShowMessageBox True and ShowSummary False. Still running the client side code, still no MessageBox. So you said:
Quote:
2. You disabled client script for the validation controls
|
And then I looked at the ValidationSummary properies and the enabled properties and noticed that one just called 'Enabled' was false. hmmm again. It's tool tip is 'Enable state of the control'.
So I set it to True and then ran. The 'MessageBox' ran. SUCCESS!!!
So below is the code first from your file on Wrox website and then the one where I have set the Enabled state to true.
Code:
<asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="ErrorMessage" HeaderText="Please correct the following errors before you press the Send button:" />
</td>
</tr>
</table>
<asp:Label ID="Message" runat="server" Text="Message Sent" Visible="False" />
Now the code that works giving you the MessageBox window.
Code:
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
CssClass="ErrorMessage"
HeaderText="Please correct the following errors before you press the Send button:"
ShowMessageBox="True" ShowSummary="False" />
</td>
</tr>
</table>
<asp:Label ID="Message" runat="server" Text="Message Sent" Visible="False" />