I tried some different I don't know it's correct way or not but I am satisfied that project is working
My target was to check session expiry.
when I login to my ASP.NET 2 Application I Store 1 user name using normal Session variable
Collapse | Copy Code
Session["username"] = txtUserName.Text
I put my MVC3 Solution in that website
In my Controllers Add Delete Update methods was there so when you run MVC Application the Controller and it's method get's called
MVC_APP/TestApp/ADD
Now for this url my Controller was like
public ActionResult ADD()
{
return View();
}
Now I added one extra parameter
public ActionResult ADD(string userName)
{
if(StringIsnullOrEmpty(userName))
{
Redirect("Logout.aspx")
}
else
{
return View();
}
}
In menu click for MVC View
for Eg ADD
Redirect("MVC_APP/testAPP/ADD?userName?="+ Session["userName"])
Redirect("MVC_APP/testAPP/Edit?userName?="+ Session["userName"])
And when anyone clicks on ASP .Net menu automatically view gets called