Page view counter

ASP.NET AJAX Validators

Rate It (7)

Last post 02-04-2009 5:35 PM by ForceMagic. 5 replies.

Sort Posts:

  • ASP.NET AJAX Validators

    01-24-2007, 12:59 AM
    • Loading...
    • mattgi
    • Joined on 06-11-2002, 12:31 PM
    • Redmond
    • Posts 107
    • Points 486
    • 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
    • Loading...
    • venkatu2005
    • Joined on 07-01-2008, 6:48 AM
    • Posts 3,129
    • Points 12,737

    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 

    Regards,
    M.Venkatesan
    My Blog


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

    10-29-2008, 8:58 PM
    • Loading...
    • Alexander_1
    • Joined on 09-12-2007, 4:11 PM
    • Posts 2
    • Points 4

    tagMapping section in the pages section of the web.config

  • Re: ASP.NET AJAX Validators

    10-31-2008, 3:47 AM
    • Loading...
    • ygor
    • Joined on 10-17-2008, 7:06 AM
    • Posts 47
    • Points 2

    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
    • Loading...
    • karyani
    • Joined on 04-11-2008, 12:20 PM
    • Posts 38
    • Points 12

    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
    • Loading...
    • ForceMagic
    • Joined on 04-02-2008, 3:05 PM
    • MainFrame
    • Posts 93
    • Points 353

     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.
Page 1 of 1 (6 items)