Passing the form action attribute to a Partial View
I have a partial view that I am using from 2 different forms. In order to use jQuery validation I would like to use the tag instead of the Html.BeginFo开发者_StackOverflowrm helper. This means that I should specify the action attribute myself just like ASP.NET MVC 2 does when I call the Html Helpers. My questions are:
- How can I do it?
- Are there better ways to do what I want to do?
Its relatively easy, simply write your form tag as follows:
<form id="myform" method="post" action='<%= Url.Action("myAction") %>'>
If you are calliing the partial from separate places this is the easiest way to achieve what you want
精彩评论