asp.net validators firing only after postback

13 posts, 0 answers
  1. Abdul Rahman
    Abdul Rahman avatar
    1 posts
    Member since:
    Oct 2011

    Posted 16 Nov 2011 Link to this post

    Hi,

    Please help in the following issue .
    The asp.net validator controls (like required field validator, compare validator etc) are firing after the postback (when the submit or rad grid insert button is pressed). This is happening in the case when the RadAjaxPanel is used.



    Thanks & Regards,
    AbdulRahman
    TCS
  2. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 18 Nov 2011 Link to this post

    Hello Abdul,

    What do you mean by saying that the validation fires after postback? Can you provide sample code for replicating the problem and a description of what happens exactly on your side?

    Greetings,
    Tsvetina
    the Telerik team
    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 their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dian
    Dian avatar
    2 posts
    Member since:
    Jan 2012

    Posted 01 Feb 2012 Link to this post

    Hi,

    Please help in the following issue .
    The asp.net Required field validator controls  are firing after the postback. But then My combobox doesn't show me any fields in there? This happens when i select a item out of my "towncombobox" that populate my next combobox "Suburbs", so i can select out of Towns but if it do the postback i don't get any items in the Suburb Combobox? can you help me please?

    Thanks
    Dian Van Eeden
    TGIS
  5. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 01 Feb 2012 Link to this post

    Hi Dian,

    I do not fully understand your scenario. What do you mean by that the validators are firing after postback? And also, can you confirm that your comboboxes work when there are no validators? If so, you can consider using ValidationGroups in your page to prevent validation of controls that should not be validated at this point.

    If the problem persists, it would be helpful if you post your code, so that we can look for any problems with it.

    Greetings,
    Tsvetina
    the Telerik team
    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 their blog feed now
  6. Dian
    Dian avatar
    2 posts
    Member since:
    Jan 2012

    Posted 02 Feb 2012 Link to this post

    Hey just want to say thanks for your support .

    I got it right after i posted the question.
    I just set Causes Validation to False and it works .

    Thanks alot
    Dian
    TGIS
  7. Atul Kumar
    Atul  Kumar avatar
    1 posts
    Member since:
    Jul 2015

    Posted 24 Jul 2015 in reply to Tsvetina Link to this post

    hi ,Tsvetina 

    please help i am also facing same problem

     

  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 28 Jul 2015 Link to this post

    Hi Atul,

    Please provide some more details for the exact scenario you are implementing and for the issue you are currently facing. Thus we can revise your case locally and advise you further.

    Regards,
    Maria Ilieva
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  9. Dan
    Dan avatar
    29 posts
    Member since:
    Oct 2013

    Posted 03 May Link to this post

    Based on these Descriptions, I am encountering the same or related issue using: (Telerik.Web.UI. v. 2015.2.623.45)
    In describing my situation let me just out by saying, that my particular set up/UI is a little complex and I believe is contributing to the behavior which I am about to describe:

    Set Up: I have 4 Grids That are all using

    EditMode="Batch"
    <BatchEditingSettings EditType="Row" />

    Each one of the grids is AJAX enabled and they are all affected/controlled by a (Customer) Selector.
    Each one of the Grids has One or more validated fields for Update,  
    ValidationSettings-CommandsToValidate="Insert,Update"
    (Example for one of the columns:)
    <ColumnValidationSettings EnableRequiredFieldValidation="true"><br>                                    <RequiredFieldValidator ForeColor="Red" ErrorMessage="<b>*</b>Required"  ValidationGroup="vgCustomers" Display="Dynamic"></RequiredFieldValidator><br>                                </ColumnValidationSettings>

    Problem:
    Validation works fine when Grids are first rendered (Unfiltered By Ajax selector), However once the Grid is (AJAX) filtered by the selector the validation does not work (looking at the rendered code confirms this the necessary mark up does not exist). Now in addition this only happens the first time around meaning if the edit is submitted (and errors) the validation reappears/works. The problem only exists when the grids reload from an AJAX post-pack initiated by the selector.

    This is common to all 4 grid even though they are all set up a little differently. They also all use a _preRender method to do some specific grid customizations.

    I can provide more code if necessary but do not want to overwhelm on initial Post.


  10. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 09 May Link to this post

    Hi Dan,

    Can you please share the entire RadGrid markup and related code behind as well as the Ajax settings you have on the page? Also please let me know which version of our controls you are using. Thus we will be able to revise the exact code locally and advise you further.


    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  11. Dan
    Dan avatar
    29 posts
    Member since:
    Oct 2013

    Posted 09 May in reply to Maria Ilieva Link to this post

    Hi Maria,

    Thanks for your response. I will appreciate any assistance provided. To that end, as per your request I can provide you with the One or all the Grid Mark up and ajax settings as well as the code behind. Is there an email address I can send this to rather than post it on this forum?

    As indicated above I am using Telerik RadControls version 2015 2nd quarter for .net 4.5 (however my Target Framework is: 4.0),

    <httpRuntime targetFramework="4.0"/>

    Which I set because when I set it to 4.5  it caused JavaScript runtime errors in my .net validators, which, as I write this makes me think that is probably very much related to the issue I am encountering(?)

    Thanks in advance, and please let me know how to proceed as far as submitting code, if still necessary?

     

     

     

  12. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 12 May Link to this post

    Hi,

    Try setting the TargetFramework to 4.5 and add the following setting int he applictaion web.config:

    <appSettings>
      <add key="ValidationSettings:UnobtrusiveValidationMode" value="WebForms" />
    </appSettings>
     
    and see how it goes


    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  13. Dan
    Dan avatar
    29 posts
    Member since:
    Oct 2013

    Posted 12 May in reply to Maria Ilieva Link to this post

    Hi Maria,

    Thanks for the suggestion. I have been down that road already, and the results are as Indicated above. The  ASP.net validators throw Javascript runtime errors. I actually answered a question in Stack dealing with that specific issue.
    http://stackoverflow.com/questions/16660900/webforms-unobtrusivevalidationmode-requires-a-scriptresourcemapping-for-jquery/34078463#34078463
    I think I may have to convert the Telerik Validaton wrappers to standard ASP.net Validation. I think that the issue is caused by a rendering conflict.

     

  14. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 17 May Link to this post

    Hi,

    Try converting the Validators and let us know what the result in this case is.

    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017