I am building a web application using .net MVC 4.
I have an ajax form for editing data.

If the user is idle for 15 minutes, it expires with the user session. When this happens, if the user clicks the "Edit" button, he will load the login page for partial content, so the current session will now expire.

Change link - cshtml code
@Ajax.ActionLink("Edit", MVC.Admin.Material.ActionNames.TagEditorPanel, MVC.Admin.Material.Name, new { isView = "false", id = Model.ID.ToString() }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "materialTagBox", InsertionMode = InsertionMode.Replace }, new { @class = "editlinks" })
Controller / Action Code
[Authorize]
public virtual ActionResult TagEditorPanel(bool isView, int id)
{
return PartialView(MVC.Admin.Material.Views._tag, response);
}
Web.config
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
I understand why this is happening. I do not know how to solve this. I want to prevent this, and I want to directly redirect the user to the login page. How can I achieve this?
Thanks in gratitude .. !!!