<% using (Html.BeginForm("AddToCart", "Cart")) { %>
<%= Html.Hidden("ProductID", pr.ProductID) %>
<%= Html.Hidden("returnUrl", ViewContext.HttpContext.Request.Url.PathAndQuery) %>
<input type="submit" value="+ Add to cart" />
<% } %>
Currently I am using
# using (Html.BeginForm("AddToCart", "Cart")) {
${Html.Hidden("ProductID", pr.ProductID)}
${Html.Hidden("returnUrl", ViewContext.HttpContext.Request.Url.PathAndQuery)}
<input type="submit" value="+ Add to cart" />
#}
Is this the right way? any better approach?