Reputation: 61
my first actioncontroller is:
return RedirectToAction("Index", "Authentication",new {code = result });
and i use the "result" parameter in diffrent controller. like
public ActionResult Index(string code)
{
...
TempData["valcode"] = code;
return View();
}
[HttpPost]
public ActionResult AuthenticateUser(string validationcode)
{
if (validationcode == TempData["valcode"].ToString())
{
return RedirectToAction("Index", "Home");
}
else
{
...
}
}
it works fine but in url, i see the code value. (http://www.test.com/Authentication/code=123) i dont want code value to be seen in url
how can i hide it from url? (besides encrypting)
Upvotes: 0
Views: 305
Reputation: 38
Try Using Sessions to pass data between controllers.
Session["valcode"] = code;
But note that, using sessions to pass data between controllers is a bad idea because it will use the app pool of the application which will eventually slow down the application. If using sessions is mandatory, make sure you destroy session variables after being used.
Hope this helps.
Upvotes: 2