I am trying to use it for Login page.
if (Session[\"UserID\"] == null) Server.Transfer(\"/Account/Login\", true);
But I get The Except
You should get the exactly same result as what you want in Server.Transfer.
public ActionResult Index() { ...... var url = "/MyContoller?param=xxx"; Server.TransferRequest(url, true); return new EmptyResult(); }