How to do conditional required field validations in ASP.net MVC2 -


i have 2 , 1 update user details change password panel. both has separate "update" button. don't want user details part validated when click on update button of change password , vice versa applies same. presently using following code in view.

    [required]     [datatype(datatype.password)]     [displaynamelocalized(typeof(capnorresource), "repeatnewpassword")]     public string repeatnewpassword { get; set; }  

in ui following code.

        <div class="passwordtd">             <%: html.labelfor(view => view.repeatnewpassword)%>             <%: html.passwordfor(view => view.repeatnewpassword)%>             <%: html.validationmessagefor(view => view.repeatnewpassword)%>         </div> 

i'm not quite sure wording of question, 2 different buttons, sounds 2 different forms 2 different viewmodels. viewmodels make 1 large viewmodel, or use renderpartial separate them completely.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -