Quantcast
Viewing all articles
Browse latest Browse all 5678

ASP.Net 4.5 Validation Controls not working with AJAX ToolkitScriptManager1

All,

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" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ></asp:ToolkitScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><div><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><br /><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><br /><asp:Button ID="Button1" runat="server" Text="Button" ValidationGroup="contentgroup" /><asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="contentgroup" ShowMessageBox="True" ShowSummary="False" /></div></ContentTemplate></asp:UpdatePanel></form></body></html>


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>