Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 14, 2013 09:02 PM by manight
Jan 18, 2013 03:49 PM|LINK
I have a project in which I am using the 'unobtrusive.....' validation so it includes the references to all the JScript libraries in the global.asax. I also have pages that utilize the ASP.Net
Validation controls and summary. For some reason I cannot get the validation controls to work correctly. Below is a summary of my challengers:
1. The first time the page loads, on the client side, when tabbing out of a field that has a required field validator attached to it, the "text" assigned to the validator does not display
2. If I click the submit button, the "text" associated with the required field validator now displays but I don't get the pop-up window from my validation summary.
3. If I then enter text in the text boxes that have required field validators assigned, the "text" assigned will not disappear until I click on the submit button.
My ASPX page code is below and I have nothing in my code behind. I have also tried with the script manager inside and outside the update panel. Any assistance would be greatly appreciated.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test1.aspx.vb" Inherits="test1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ></asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator" ValidationGroup="contentgroup">*</asp:RequiredFieldValidator>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox2" ErrorMessage="RequiredFieldValidator" ValidationGroup="contentgroup">*</asp:RequiredFieldValidator>
<asp:Button ID="Button1" runat="server" Text="Button" ValidationGroup="contentgroup" />
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="contentgroup" ShowMessageBox="True" ShowSummary="False" />
Jan 21, 2013 03:00 AM|LINK
Watch this video it may helphttp://www.asp.net/learn/ajax-videos/video-150.aspx Also check out the validator callout sample at
Jan 30, 2013 01:47 AM|LINK
I am not using and cannot use the Validation Callout but that is not the source of the problem regardless. I have verified the source of the problem is the UnobtrusiveValidationMode. I was attempting to use UnobtrusiveValidationMode with the jquery 1.9.0
libraries and none of my client side validation was working. When I added the line of code below to disable the UnobtrusiveValidationMode everything went back to working normal.
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
If anyone knows how to get the client side validation to work with the UnobtrusiveValidationMode and jquery 1.9.0 please let me know. I believe I followed all the needed steps for implement the UnobtrusiveValidationMode but it did not work with jquery 1.9.0.
May 14, 2013 09:02 PM|LINK
Thanks GCeaser you saved my life after 5 hours of hell trying to understand why client side validation won't work even on the most basic examples.
What I don't understand is that ASP.NET 4.5 is relatively new, I think now many people switched to it, validation (and client side validation) even with ajax enable is still a common pratice even on the most simple dynamic sites, jQuery 1.9+ is the actual
standard so... how is it possible that in the whole world only me and you struck into this issue... I was really going mad! And also, now that I got to the core of the issue, even if I do targeted searches on the subject, this is the only topic where someone
seems to have had the issue.
This is quite mindblowing for me... also that the Unobtrusive option is on by default doesn't seem a wise choice to me both for the HTML5 and mostly for such problems. At least it should be pointed out more obviously together with the new feature how to
disable it, not just in the last line of a MS reference page... I know I'm a bit polemic here but after 5 hours of this $%!#!"" you can understand me..