i have 2 asp.net mvc views.
view1.aspx and view2.aspx.
of course they are [HTTPGet] Actions
for each view as 开发者_如何学Pythonwell Models View1Model.cs and View2Model.cs
in view1.aspc I have a hyperlink <a href="\view2"></a>
, by clicking on it I'am landing on view2.aspx.
i want to pass some text message from view1 to view2 and display it on view2.aspx.
i want to do that with with POST method, how to do it?
You can send a POST to any action by using an HTML form with the url as view2.aspx.
Any fields within that form (eg a hidden field) are then sent as POST data and can be accessed via a parameter in the view2 action or can be bound to View2Model.
You should use the Html.BeginForm()
helper for this.
I have to use just a proper HTML.ActionLink and thats it! Best answer is here
精彩评论