Validation Controls Error Message Missing after AJAX post-back

Last post 01-20-2009 2:07 PM by sunithashukla. 7 replies.

Sort Posts:

  • Validation Controls Error Message Missing after AJAX post-back

    05-30-2007, 2:11 AM

    I have a master template with a script manager and update panel (AjAX extensions, .Net 2.0).

    I have created a web form to do Product Info updating using the master template. Within the page, it has a few text boxes with validation controls such as Required and Custom Validator. Before a post-back, whenever there is an error, the validators will trigger and display the intended message accordingly. I have attched a sample of it. 

    <asp:RequiredFieldValidator ID="reqvalUserName" runat="server" ControlToValidate="txtUserName" meta:resourcekey="reqvalUserName" CssClass="errMsg">*</asp:RequiredFieldValidator>

    After a successful post-back with the record being updated, the validators are still working but it won't display the error message anymore in the validation summary. I am not sure if it is due to the Local Resource Key or what. Pls enlighten me. Thks.

     

     

  • Re: Validation Controls Error Message Missing after AJAX post-back

    05-30-2007, 11:49 PM
    Answer

    Controls that Are Not Compatible with UpdatePanel Controls

    The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside an UpdatePanel control:

     See this link for more info

    http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

    Here is compatible Validation Controls

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

     

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: Validation Controls Error Message Missing after AJAX post-back

    05-31-2007, 4:26 PM
    • Participant
      1,863 point Participant
    • WishStar99
    • Member since 08-05-2006, 12:11 AM
    • VietNam
    • Posts 553

    DragonBall Z  ... I'm Goku ... =)

    first off, I recently encountered something similar. My textboxes and <asp:RequiredFiledValidator were inside the UpdatePanel ... at every postback, these errorMessages disappear. What I did was, I move them outside the UpdatePanel, I only leave the textboxes inside and it works ... try that ...

     

    Good Luck .....

    //---------------------------------------------//
    //------------------- Chloé ------------------//
    //---------------------------------------------//
  • Re: Validation Controls Error Message Missing after AJAX post-back

    05-31-2007, 11:40 PM

    Indeed, it has resolved the issue. Thks.

  • Re: Validation Controls Error Message Missing after AJAX post-back

    06-01-2007, 12:53 AM

    If issue is resolved then try to set "Mark asAnswer" so it will help for others...

    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: Validation Controls Error Message Missing after AJAX post-back

    06-04-2007, 2:27 AM

    Hi,

       Is there any fix for FileUpload control like Validation controls?

    Ryan 

     

     

  • Re: Validation Controls Error Message Missing after AJAX post-back

    06-06-2007, 12:40 AM
    Chetan Sarode
    Software Engineer,
    Approva Systems Pvt Ltd,
    Pune, India.
  • Re: Validation Controls Error Message Missing after AJAX post-back

    01-20-2009, 2:07 PM
    • Member
      4 point Member
    • sunithashukla
    • Member since 01-20-2009, 1:47 PM
    • Posts 2

    Hi,
    1)I am having same issuse.ie., I have a Textbox,Button,RequireFieldValidation inside an update panel.
      First time it is working properly and my error message is shown.
    2)After page load ,RequireFieldValidation is working but i am not able to see my error message.
    3)When i remove my update panel it is working fine.So i though ,this issuse is with update panel.
    4)As you post in this link, i downloaded all that validation controls and place its dll in my Bin folder.
      and also i added tagmapping in my web.config file and added that control to my web page.

    5)My code is below :-

    Sample.Web.UI.Compatibility.RequiredFieldValidator Rqfdv = new Sample.Web.UI.Compatibility.RequiredFieldValidator();

    Rqfdv.ID = "rfv" ;

    Rqfdv.ControlToValidate = "$txtInput";

    Rqfdv.ToolTip = "txtInput Cannot be blank.";

    Rqfdv.ErrorMessage = "*";

    Rqfdv.ValidationGroup = "FooterGroup";

    cell.Controls.Add(Rqfdv);

    6)But now same thing happening ie., after Postback it is firing but not showing error message.
    7)Can you please help me.

Page 1 of 1 (8 items)