Im facing a problem. I have a listing page in which i list all the links and for searching purpose i render the form in
Ajax.BeginForm("InitializeUserSearch", new AjaxOptions {UpdateTargetId="divGrid" })
and in divGrid the resultant records displays. In Controller if the session expires then i redirect it to login view
if (!SessionAlive)
{
return RedirectToAction("Login", "UserLogin");
}
The problem is when session expires it renders the View in that user control and it looks like a new page in main page. What may be the problem?
For reference im attaching the screenshot after session expires
Im using Asp.Net-MVC 2
If you redirect in an AJAX invoked action it will most probably return an entire HTML page whereas you need to return only an HTML partial. After checking for session expiration instead of redirect you could return a partial view containing the login partial: