ASP.NET AJAX Validators

Rate It (7)

Last post 12-03-2009 2:41 PM by marcosjsramos. 6 replies.

Sort Posts:

  • ASP.NET AJAX Validators

    01-24-2007, 12:59 AM
    • Member
      486 point Member
    • mattgi
    • Member since 06-11-2002, 12:31 PM
    • Redmond
    • Posts 107
    • AspNetTeam

    ASP.NET AJAX provides new APIs for registering script with the ScriptManager.  Using these APIs allows controls to work well with partial rendering.  Without them, controls placed inside an UpdatePanel won't work as expected. In previous CTP releases of ASP.NET AJAX, we had a set of validator controls that derived from the v2.0 controls and used the new APIs. This made them work well with ASP.NET AJAX. WindowsUpdate will soon include a version of System.Web that can take advantage of the new APIs.  So the new controls which would have been redundant have been removed.  However, the update isn't available yet and ASP.NET AJAX has been released.  So, in the short-term, the source code for a set of custom validator controls that work with partial rendering is available as an attachment to this post or on my blog http://blogs.msdn.com/mattgi/attachment/1516974.ashx

    The .zip file includes a solution and .csproj file as well as the compiled DLL.  Just put the DLL in the /bin directory of your application and include the following <tagMapping section in the pages section of the web.config.

          <tagMapping>
            <add tagType="System.Web.UI.WebControls.CompareValidator"           mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>
            <add tagType="System.Web.UI.WebControls.CustomValidator"            mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>
            <add tagType="System.Web.UI.WebControls.RangeValidator"             mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>
            <add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>
            <add tagType="System.Web.UI.WebControls.RequiredFieldValidator"     mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>
            <add tagType="System.Web.UI.WebControls.ValidationSummary"          mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>
          </tagMapping>

    http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx



    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: ASP.NET AJAX Validators

    10-01-2008, 6:37 AM
    • All-Star
      21,034 point All-Star
    • venkatu2005
    • Member since 07-01-2008, 10:48 AM
    • Posts 4,573

    Hi

    I have used the same concept but it shows err like

    Unrecognized configuration section system.web/tagMapping.

    Can u provide the solution wat the error?

    Thanks 

    I have Changed My Blog from (http://venkat-dotnetsamples.blogspot.com) to (http://venkat-dotnetsnippets.blogspot.com)

    Regards,
    Venkatesan.M

    Please Mark as Answered If its helpful and Un-Mark as Answered if it not help u.
  • Re: ASP.NET AJAX Validators

    10-29-2008, 8:58 PM
    • Member
      4 point Member
    • Alexander_1
    • Member since 09-12-2007, 4:11 PM
    • Posts 2

    tagMapping section in the pages section of the web.config

  • Re: ASP.NET AJAX Validators

    10-31-2008, 3:47 AM
    • Member
      2 point Member
    • ygor
    • Member since 10-17-2008, 7:06 AM
    • Posts 48

    I found out that this patch would not fix my issue, which is to setfocus to the control that fails validation, and doubt if this is fixed in AJAX 2.0 as well.

    In my case:

    Validator Setting:

    EnableClientScript="False"

    SetFocusOnError="True"

    Test Result 

    Inside UpdatePanel fails

    outside UpdatePanel works

    So SetFocusOnError does something even when EnableClientScript is off when not being placed inside UpdatePanel. The behavior is not consistent.

     

  • Re: ASP.NET AJAX Validators

    12-12-2008, 8:55 AM
    • Member
      12 point Member
    • karyani
    • Member since 04-11-2008, 12:20 PM
    • Posts 38

    Thank you for your respond,

     I tried it but I am still getting the error.  The thing is when I run the application to debug it on my machine every thing works fine.  The problem occurs only when I publish the website

  • Re: ASP.NET AJAX Validators

    02-04-2009, 5:35 PM
    • Member
      353 point Member
    • ForceMagic
    • Member since 04-02-2008, 7:05 PM
    • MainFrame
    • Posts 93

     Hello,

     When I add this tag in my web.config, suddenly in all my .aspx.vb page every control who refers to an .aspx page or master page are not found anymore. ("control" is not a member of "....") Is there a property I need to set somewhere to avoid those error, atm I have no clue.

     

    <system.web>
      <pages>
        <tagMapping>
           <add tagType="System.Web.UI.WebControls.RequiredFieldValidator" 
    	     mappedTagType="System.Web.UI.Compatibility.RequiredFieldValidator,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
        </tagMapping>
      </pages>
    </system.web>
      Thx in advance
    ~ ForceMagic - Aleajecta Dev Team ~

    Please click “Mark as Answer” on the post that helps you, and click “Unmark as Answer” if a marked post does not actually answer your question.
  • Re: ASP.NET AJAX Validators

    12-03-2009, 2:41 PM
    • Member
      2 point Member
    • marcosjsramos
    • Member since 12-03-2009, 10:33 AM
    • Posts 1

    Unfortunately, despite of following instructions, the presence of the validators is blocking the updatepanel to work

Page 1 of 1 (7 items)