Click here to Skip to main content
15,883,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to know how to pass parameters from HttpGet to HttpPost in asp.net mvc3.
when i am trying i am getting null values and in HttpPost it has to read values from querystring.

If possible plz post the code with example.



thanks,
lokesh
Posted
Comments
Jameel VM 26-Sep-13 10:14am    
Please post the code wat you have tried?We couldn't understand your problem

1 solution

You can use tempdata for this situation
like this
:
[HttpGet]
public ActionResult Index()
{

TempData["hi"]="hello";
return View();

}

[Httppost]
public ActionResult Index(Model model)
{
var s=TempData["hi"].ToString();
return View();
}



I hope this will help

Cheers !!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900