Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a very simple web form where a user either provides registration information, or chooses to make a purchase anonymously. So obviously, I need to run validators for one input button and not when the other is clicked.

I suspect that I could do it with two begin and end form sections, but I don't really like that for the way I want the page to lay out. That also just feels like a bad way to do it to me.

I am a complete newb to MVC and razor, but am liking everything I am seeing so far. I just don't know how to do some of the basic things yet. Any help would be greatly appreciated.
Posted

1 solution

The specifics of what I need definitely worked easiest by just doing two forms
@BeginForm("Register","Purchase"){...


and later
@BeginForm("Anonymous","Purchase"){....

I still hope that someone can give me more information on how to toggle a validator.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900