RadScriptManager and ASP.Net Validators

18 posts, 0 answers
  1. Mark Teichman
    Mark Teichman avatar
    2 posts
    Member since:
    Oct 2009

    Posted 25 Mar 2010 Link to this post

    When I add RadScriptManager to my .aspx Page the ASP.Net validators stop working,
    by which I mean i still get a post back.

    I've read a couple of entries on this Forum about the same exact problem.
    the first solution is to re-register the 'Telerik.Web.UI.WebResource.axd' in the config file...
    I removed all 'Telerik.Web.UI.WebResource.axd' from the config file,
     then I placed a RADScriptManager on my aspx page and I clicked the option on the RADScriptManager that does register the 'Telerik.Web.UI.WebResource.axd'.
    The 'Telerik.Web.UI.WebResource.axd' get registered in the Config file, but that didn't solve my validation issue.

    The Second entry on this Forum talks about the config file missing some .Net related httpHandlers which are needed to make RadScriptManager function properly.
    while a couple of people talk about it, no one shows a list of the required httpHandlers.

    Can someone please give me a list of the httpHandlers required to solve the RadScriptManager and ASP.Net Validators issue?

    Please not that:
    1. my application was written in Net 2.0 and converted later to .Net 3.5  
    Using the 'Target Framework' Drop Down List on the Web Site Property Pages on Visual Studio 2008.
    2. I'm using IIS 7

    Thanks in Advance.
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 29 Mar 2010 Link to this post

    Hello Mark Teichman,

    Since you changed the TargetFramework you need to use the Telerik assembly from the Bin35 folder. Its version should end with .35 instead of .20.

    The problem could be caused by missing sections in the web.config.
    If you use Ajax (or any Telerik RadControl for ASP.NET Ajax) you need to create a new Ajax Enabled Web Site (in VS 2005). That template will create the appropriate web.config file. But, if you create a new Web Site (Ajax enabled is missing) the web.config file lacks the important settings for the ajax scripts.

    Find attached a sample web.config targeting .NET 3.5

    Sincerely yours,
    Veskoni
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark Teichman
    Mark Teichman avatar
    2 posts
    Member since:
    Oct 2009

    Posted 29 Mar 2010 Link to this post

    Veskoni;

    thank you for your help.
    I made sure that all the web.config entries in the AJAX enabled site are present in my existing web.config,
    all went fine after that.

    Thank you.
  5. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 25 Nov 2013 Link to this post

    I have this same problem.
    RadScriptManager disable the client side capability of validators.
    How to solve the problem on ASP.Net 4.5?
  6. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 25 Nov 2013 Link to this post

    I found out that it's resolved by disabling the unobtrusive validation mode. When I added this to web.config the validators worked properly
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
  7. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 29 Nov 2013 Link to this post

    Hi,

    Can somebody from Telerik shine some light on this issue?
    How to work with the new Unobtrusive client side validation in combination with a RadScriptManager and jQuery.

    That would really help a lot of people who want to switch existing applications to ASP.NET 4.5

    Thanks.

    Marc
  8. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 29 Nov 2013 Link to this post

    Greetings Marc,

    This is one of the nuisances of ASP.Net as a whole, not just Telerik. The problem is that there's no way to control the order of scripts added using RegisterStartupScript, RegisterClientScriptBlock, RegisterClientScriptResource, and the scripts added as references to ScriptManager.

    The problem is that the script element that references the validators scripts is added earlier than jQuery that RadScriptManager adds (of course if you have the embedded jQuery enabled). If you look at the validators code, you will find that it checks for the existence of jQuery to do the validators initialization based on data- attributes added while on unobtrusive mode. The code doesn't find jQ so it doesn't initialize the validators. If you try to include jQ yourself and disable the embedded jQ, Telerik plugins that depend on jQ will stop working (I found this problem messy so didn't try to resolve it or even understand why it happens).

    Maybe Telerik can help by providing guidelines for including jQ in both the embedded and external modes.
  9. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 02 Dec 2013 Link to this post

    Hi Ashraf,

    I totally understand and agree with you that Telerik should write a short guidance on the (im)possibilities and configuration of the RadScriptManager incombination with ASP.NET 4.5 unobtrusive validation objects.

    Telerik, anyone??

    Marc
  10. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 03 Dec 2013 Link to this post

    Hello,

    Thank you Ashraf, for explaining the issue in detail. We confirm that this is the problem at hand. Currently the only option is to disable UnobtrusiveValidationMode, as you've previously suggested. However we are working on the issue so that we can make RadScriptManager work together with the new validation in .NET 4.5. Please follow our release history for any updates on the issue.

    Regards,
    Bozhidar
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  11. Ashraf Sabry
    Ashraf Sabry avatar
    88 posts
    Member since:
    Jan 2011

    Posted 12 Dec 2013 Link to this post

    I found a forum post here about the issue. It points to a ticket at Microsoft Connect that has a possible solution.
  12. Mohammed
    Mohammed avatar
    16 posts
    Member since:
    Nov 2013

    Posted 04 Mar 2014 in reply to Ashraf Sabry Link to this post

    i have the same issue in 2013 Q3 SP2 And .NET 4.5 .

    and adding the key to config solve it .

    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
  13. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 09 Sep 2014 Link to this post

    Hi Telerik:

    I could not find this issue in release notes.  Is this fixed? ... and in what release?

    Phil
  14. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 10 Sep 2014 Link to this post

    Hello,

    The unobtrusive validation relies on window.jQuery in order to work, and since we don't want to override this variable with the embedded jQuery of the controls by default (we place our jQuery in the $telerik.$ variable), the solution to the issue is to disable the embedded jQuery and load one manually before the validator scripts are loaded. You can read on how to disable the embedded jQuery in this help article:
    http://www.telerik.com/help/aspnet-ajax/scriptmanager-disabling-embedded-jquery.html

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  15. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 10 Sep 2014 in reply to Bozhidar Link to this post

    Hi Bozhidar:

    I invoke the script manager as follows:
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
      <Scripts>
        <asp:ScriptReference Path="Scripts/jquery-1.11.1.min.js" />
      </Scripts>
    </telerik:RadScriptManager>
    I thought I was overriding the Telerik embedded jQuery.
    Phil 
  16. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 10 Sep 2014 in reply to Phil H. Link to this post

    Hi Bozhidar:

    Additionally, is this the suggested solution per Telerik?
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableEmbeddedjQuery="false">
      <Scripts>
        <asp:ScriptReference Path="Scripts/jquery-1.11.1.min.js" />
      </Scripts>
    </telerik:RadScriptManager>
    Phil
  17. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 12 Sep 2014 Link to this post

    Hi Phil,

    To ensure that the jQuery is loaded before the validation scripts, you have to add the reference manually on the page with an ordinary <script> tag, in addition to setting the EnableEmbeddedjQuery property. Like so:
    <script src="../Resources/jQuery/jquery-1.9.1.js"></script>
    <telerik:RadScriptManager runat="server" EnableEmbeddedjQuery="false">
    </telerik:RadScriptManager>

    I also want to note that the controls for ASP.NET Ajax are tested and working with jQuery version 1.9.1. In later versions of jQuery a lot of the old browsers features were dropped and the controls may not work properly.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  18. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 12 Sep 2014 in reply to Bozhidar Link to this post

    Hi Bozhidar:

    I am aware that the 2.x versions of jQuery drops support for older browser, that is why I am still using the latest 1.x version.  
    Are you saying that 1.11.1 breaks Asp.Net Ajax Rad Controls?

    Phil
  19. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 15 Sep 2014 Link to this post

    Hello,

    You are correct, the old browsers were deprecated in versions 2.x, while 1.11.1 continues the support. There shouldn't be any issues with this version, however we can only guarantee no issues with the 1.9.1 version, since it's the one we currently test the controls on.

    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017