2

i have 2 asp.net mvc views.

view1.aspx and view2.aspx.

of course they are [HTTPGet] Actions for each view as well 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?

tereško
  • 58,060
  • 25
  • 98
  • 150
r.r
  • 7,023
  • 28
  • 87
  • 129

2 Answers2

1

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.

el_tone
  • 1,182
  • 8
  • 16
0

I have to use just a proper HTML.ActionLink and thats it! Best answer is here

Community
  • 1
  • 1
r.r
  • 7,023
  • 28
  • 87
  • 129