Lets say you want to pass ID parameter to the controller. You can do it in 2 ways:
Via QueryString:
Or Via Hidden Fields:
Either way its fine, browser will add any form elements to the querystring automatically, so difference in performance as well.
Via QueryString:
<form method="post" action="@Url.Action("DoSomething", "Customer", new { id = Model.ID })">
</form>Or Via Hidden Fields:
<form method="post" action="@Url.Action("DoSomething", "Customer")">
<input type="hidden" value="@Model.ID" />
</form>
Either way its fine, browser will add any form elements to the querystring automatically, so difference in performance as well.
No comments:
Post a Comment