Answered by:
Validation Controls Error Message Missing after AJAX post-back

Question
-
User-326298195 posted
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.Wednesday, May 30, 2007 2:11 AM
Answers
-
User555306248 posted
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:
-
Web Parts controls. For more information, see ASP.NET Web Parts Controls.
-
FileUpload controls when they are used to upload files as part of an asynchronous postback.
-
GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false.
-
Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates.
-
The Substitution control.
-
Validation controls, which includes the BaseCompareValidator, BaseValidator, CompareValidator, CustomValidator, RangeValidator, RegularExpressionValidator, RequiredFieldValidator, and ValidationSummary control
See this link for more info
Here is compatible Validation Controls
http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 30, 2007 11:49 PM
All replies
-
User555306248 posted
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:
-
Web Parts controls. For more information, see ASP.NET Web Parts Controls.
-
FileUpload controls when they are used to upload files as part of an asynchronous postback.
-
GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false.
-
Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates.
-
The Substitution control.
-
Validation controls, which includes the BaseCompareValidator, BaseValidator, CompareValidator, CustomValidator, RangeValidator, RegularExpressionValidator, RequiredFieldValidator, and ValidationSummary control
See this link for more info
Here is compatible Validation Controls
http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 30, 2007 11:49 PM -
User336673788 posted
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 .....
Thursday, May 31, 2007 4:26 PM -
User-326298195 posted
Indeed, it has resolved the issue. Thks.
Thursday, May 31, 2007 11:40 PM -
User555306248 posted
If issue is resolved then try to set "Mark asAnswer" so it will help for others...
Friday, June 1, 2007 12:53 AM -
User-326298195 posted
Hi,
Is there any fix for FileUpload control like Validation controls?
Ryan
Monday, June 4, 2007 2:27 AM -
Wednesday, June 6, 2007 12:40 AM
-
User-462400981 posted
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.
Tuesday, January 20, 2009 2:07 PM