Customvalidator Validationsummary Error Message
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta add message to validationsummary Discuss the workings and policies of this site About Us Learn more
Asp.net Custom Validator Error Message Not Displaying
about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack add error to validationsummary from code behind Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, asp.net validationsummary helping each other. Join them; it only takes a minute: Sign up Custom Validator firing but it does not update the ValidationSummary up vote 3 down vote favorite Hi I am working on a custom form field validator, it seems like the custom validator is working by not allowing it to continue to the next page, but it
Asp Custom Validator
doesn't update the Validation Summary nor does it display the asterisk and the labels that i've made visable. I also have other validators like RequiredFieldValidator on the same field. My ValidationGroup is set, as is the Text and IsValid. I even wrote and set a dummy client side validation method in javascript as some workarounds suggests. here is the validation summary code in asp.net
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/Web Forms/How to show error mesage from "CustomValidator" to "ValidationSummary... How to show error mesage from "CustomValidator" to "ValidationSummary" control? RSS 8 replies Last post Apr 14, 2005 12:06 PM by PLBlum ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Related Links GuidanceSamplesVideos Reply bosox04 None 0 Points 71 Posts How to show error mesage from "CustomValidator" to "ValidationSummary" control? Apr 12, 2005 04:34 PM|bosox04|LINK Hello All, I have an aspx page with several "requiredfieldvalidator" and http://stackoverflow.com/questions/4308475/custom-validator-firing-but-it-does-not-update-the-validationsummary one "customvalidator" for the checkbox. I use a "ValidationSummary" with the ShowMessageBox="true" to display a popup summary of all required fields. All error message from "RequireFieldValidator" are shown accordling, but not the error message from "CustomValidator". Anyone know why? and how to correct it? Thanks Reply daver None 0 Points 178 Posts Re: How to show error mesage from "CustomValidator" to "ValidationSummary" control? Apr 12, 2005 http://forums.asp.net/t/875239.aspx?How+to+show+error+mesage+from+CustomValidator+to+ValidationSummary+control+ 06:06 PM|daver|LINK I assume your custom validator is doing server side work to determine the validity of the data, correct? If so, once you determine that the data is invalid, add the custom validator to you validation summary in your code behind. -- daver Reply ahooi99 None 0 Points 165 Posts Re: How to show error mesage from "CustomValidator" to "ValidationSummary" control? Apr 12, 2005 10:20 PM|ahooi99|LINK You can write your CustomValidation logic in client side by using the javascript. Then for your CustomValidator, set the ClientValidationFunction to your javascript function. It works as RequiredFieldValidator, without causing any postback.. [:)] -- Tough People Do Tough Task -- Reply bosox04 None 0 Points 71 Posts Re: How to show error mesage from "CustomValidator" to "ValidationSummary" control? Apr 13, 2005 09:13 AM|bosox04|LINK Daver, yes I use server side for my custom validator. How do I add the custom validator to my ValidationSummary control? Reply bosox04 None 0 Points 71 Posts Re: How to show error mesage from "CustomValidator" to "ValidationSummary" control? Apr 13, 2005 11:30 AM|bosox04|LINK ahooi99, do you have any samples? Reply daver None 0 Points 178 Posts Re: How to show error mesage from "CustomValidator" to "ValidationSumma
Summary control.So i expect it to show a messagebox when my custom validation fails.For testing purpose in my servervalidate event handler of CustomValidator i made the ServerValidateEventArgs.IsValid to false.So i expect the validation to fail https://www.sitepoint.com/community/t/customvalidator-and-validationsummary-control-issue/1277 and show a messagebox,everytime i enter some valuse in my text box and click on the button .But the messagebox is not displayed and to add to my confusion if i set the ShowMessageBox=false and ShowSummary=true the validation summary report is shown properly.So how can i display the messagebox if my customvalidation fails.is this a bug with controls or am i missing anything here?I don't want to error message make this posting bulky,so will post the code if itz of some use. Someone pls help me out to fix this problem. Thanxngmtech jofa 2003-01-26 13:02:04 UTC #2 Yep, this is weird, and the ridiculous answer to the question is; the function that displays the alert() isn't called if you post the form using Enter in a textbox for example - if you click the Submit button, customvalidator validationsummary error then it's working(Must be some way to change the page to call Page_ClientValidate() on onsubmit for the form) If this explanation doesn't apply to your problem, check that EnableClientScript is set to true Edit:I noticed this: "...in my servervalidate event handler..."Don't you mean ClientValidationFunction ?It's a bit difficult to pop up a message box from the server ngmtech 2003-01-27 08:22:08 UTC #3 thanx for the reply.But i am not using any client side validation for custom control.I am using the ServerValidate event(As per MSDN The ServerValidate event is raised when validation is performed on the server) of custom validator to perform checking against database and for testing purpose(to show messagebox) am setting IsValid to false all the time so that Messagebox of valdationsummary control to pop up.So my question is that if validationsummary can show a summary report for the validations done in ServerValidate event then y it is not showing messagebox properly even though Isvalid is set to false.is my question clear enough?if not i will post more code to elaborate on this problem Thanxngmtech dhtmlgod 2003-01-27 10:40:15 UTC #4 Could you post a little code? ngmtech 2003-01-27 12:34:29 UTC #5 //aspx code