User-775001650 posted
Hi ,
I am facing issue while redirect to another control when session as expired. I am using some java script method to call ActionMethod1
- .ajax({
- type:
"get",
- url: "/SomeController/ActionMethod1",
- data: { accountNumber: accountNumber
}, dataType: 'json',
- success: function(response){$(target).html(response);};")
- error:function(response){$(target).html('An error occured');
- });
I have the below ActionMethod which is having RedirectToActionMethod.
public ActionResult ActionMethod1()
{
if(Session==null)
{
return RedirectToActionMethod("Signoff","Logout");
}
return PartialView();
}
}
public ActionResult Signoff()
{
return view();
}
Issue : when I redirect to Sighoff action method it is returning View but it is binging signoff view at line no: 5. which javascript function is calling initially .
Query: How to stop the initially javascript call if session is null .
Thanks in advance,
Venkat