Validators using ajax not working anymore?

Last post 10-01-2008 6:44 AM by venkatu2005. 6 replies.

Sort Posts:

  • Validators using ajax not working anymore?

    10-04-2007, 11:18 AM
    • Loading...
    • Luis Simoes
    • Joined on 04-11-2007, 11:07 PM
    • Portugal
    • Posts 38

    Hi,

    How can i use the standard, required rield validator, custom validator etc... with ajax? My controls dont fire any type of validation and if i force a Page.Validate it always says its valid and dont fire the custom events... Why is this happening? Can anyone make this work?

    Best Regards

  • Re: Validators using ajax not working anymore?

    10-04-2007, 11:48 AM
    • Loading...
    • dwhite
    • Joined on 02-08-2007, 2:25 PM
    • Bristol, CT
    • Posts 1,399

    See http://blogs.visoftinc.com/archive/2007/09/23/asp.net-ajax-updatepanel-not-working-common-problems.aspx, specifically the section Controls Not Compatible w/ UpdatePanel

    -Damien

     

    Visoft, Inc - Home | Blogs

    Latest Blog Post: ASP.NET AJAX Page Methods
  • Re: Validators using ajax not working anymore?

    10-04-2007, 12:18 PM
    • Loading...
    • Luis Simoes
    • Joined on 04-11-2007, 11:07 PM
    • Portugal
    • Posts 38

    Hi Damien,

    I had already been to that blog and use the validators.dll with the web.config changes... nothing happened...

    This is the way i am using in the RowCommand of the gridview:

     

    1    Protected Sub GridDetails_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridDetails.RowCommand
    2      Page.Validate()
    3      If e.CommandName = "Insert" AndAlso Page.IsValid() Then
    4       ...
    5       ...
    6      End If
    7    End Sub
    

     

    This is my asp.net code for the customvalidator inside the gridview templatefield:

    1    <FooterTemplate>
    2        <asp:TextBox ID="txt_newVendorPC" runat="server" MaxLength="7" Columns="7" Text=""></asp:TextBox>
    3        <asp:CustomValidator ID="cus_txt_newVendorPC" meta:resourcekey="cus_txt_newVendorPC" runat="server" ControlToValidate="txt_newVendorPC"
    4             CssClass="alert" Display="Dynamic" ErrorMessage="Error Message Here!" OnServerValidate="cus_txt_newVendorPC_ServerValidate"
    5             ValidationGroup="NewDetails" EnableClientScript="false">*</asp:CustomValidator>
    6    </FooterTemplate>
    
     
  • Re: Validators using ajax not working anymore?

    10-04-2007, 1:41 PM
    • Loading...
    • dwhite
    • Joined on 02-08-2007, 2:25 PM
    • Bristol, CT
    • Posts 1,399

    Try getting rid of the ValidationGroup.  I found this post: http://weblogs.asp.net/lkempe/archive/2007/03/26/asp-net-ajax-and-asp-net-validators.aspx and the comment "Related to my previous comment: I have found out the reason why the Validation controls were not working in the UpdatePanel. It is because of the ValidationGroup property. I had had grouped my validators for the UpdatePanel by setting their ValidationGroup property to prevent them from validating their connected controls with the other validators on the page. However, it is surprising to see that there is no need to set the ValidationGroup property for controls if being placed in an UpdatePanel. Removing the ValidationGroup property solves the problem and the validators work fine."

    -Damien

    Visoft, Inc - Home | Blogs

    Latest Blog Post: ASP.NET AJAX Page Methods
  • Re: Validators using ajax not working anymore?

    10-04-2007, 2:09 PM
    Answer
    • Loading...
    • Luis Simoes
    • Joined on 04-11-2007, 11:07 PM
    • Portugal
    • Posts 38

    Hi Damien,

    Thanks for all your help.

    I have fixed my head because it was what was really wrong eheheh

    I never realized that the custom validator is not fired if the textbox is empty... so i added a requiredfieldvalidator and it started working...

     

    Once again thank you, and sorry for wasting your precious time.

     

    Best Regards,

  • Re: Validators using ajax not working anymore?

    10-04-2007, 11:40 PM
  • Re: Validators using ajax not working anymore?

    10-01-2008, 6:44 AM

    Hai I am working with Asp.net 2.0

    can you help i have the same issue , i have placed dll file and add the tagmappin

    to web.config it shows error like

    Unrecognized configuration section system.web/tagMapping.

    can u give wat the error is..? 

    Regards,
    M.Venkatesan


    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.
Page 1 of 1 (7 items)
Microsoft Communities
Page view counter