ASP.net Custom Multiple control validator javascript issue
I've used the code in this article before to create a custo开发者_高级运维m validator to validate mupltiple controls on a page. Using the "inline method" to hook up the validators just beofre the closing form tag.
This time I'm making a user control and want the control to handle the generatio/rendering of the javascript to hook up the validators. The problem is that using the RegisterStartupScript method to add the script will add the script before the automatically added ValidatorOnSubmit() method.
My current thought for a work around is to have a method that can be called from the page containg the control to add the javascritp to hook up the validators but I'd rather have a control I can just drop onto a page without the user having to worry about hooking anything else up.
Is there a way, from my user control to render the javascript to hook up the validaors after the ValidatorOnSubmit() method?
I've tried this.Page.ClientScript.RegisterStartupScript and this.Page.RegisterStartupScript with both rendering the javascript too early.
I ended up use this control. I really whish I'd found this earlier in the day!
精彩评论