Reputation: 441
I am new to Razor and Webmatrix.I was trying to pass values using POST method from one page to another page but i am not able pass values. I have googled on it but didn't get any solutions. So can any one provide me the guidance?
Upvotes: 0
Views: 5159
Reputation: 2078
A typical way to do it if both pages are in the same project:
Upvotes: -1
Reputation: 1038810
What are you having difficulties with? On one page you create a <form>
:
<form action="/foo.cshtml" method="post">
<input type="text" name="bar" value="" />
<button type="submit">OK</button>
</form>
and on the other page you read values from the request: Request["bar"]
:
@{
var bar = Request["bar"];
}
Upvotes: 5