asp.net - Using server side validators with modal dialog (jquery)? -


is there straightforward way use server-side validation asp.net's validation controls in form that's displayed in modal dialog? using jquery , simplemodal (in c#, vs2010, .net 4.0)

i've got modal form works fine. need use server-side validation because logic depends on data specific record being accessed

my solution project i'm working on use jquery ajax call pass form data server , validation results before allowing post proceed. relatively time consuming implement, , in situations i'm dealing validation code exists already.

the first challenge of course modal dialog close on full postback. put updatepanel inside dialog... without thinking much, though, assumed wouldn't work out well. doesn't. , form opens modal dialog begin in updatepanel, further confuses matters.

anyway, tried putting contents of modal form in updatepanel heck of it. partial postback, dialog remains open, contents of dialog not updated change server side. if close , re-open dialog on same page after testing validation code, though, contents in fact updated reflect these changes. way dialog rendered confusing asp.net. or vice-versa. seems sketchy get-go.

rather trying hack way through problem hoping others had suggestions better way approach this. or tell me i'm trying hard mix apples , oranges , should keep client side (or client side + jquery ajax) if sensible thing do.

the 2 approaches i've taken:

1) submit data via ajax, response includes success:true or false. if false, there message included details issue.

2) submit form normally. if there validation problem, errors in hidden div on page , write js check content in div when page loads , display warning/error necessary.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -