Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
how to redirect page in string method(MVC)
Dheeraj Sharma
Jan 3 2018 12:21 AM
130
Reply
i want to redirect my page to Login Page when user clicks on logout,
how can i redirect, below is my code
public string LogOut(Login log)
{
using (simpleEntities dbContext = new simpleEntities())
{
int ID = Convert.ToInt32(log.ID);
Login s_data = dbContext.Logins.Where(x => x.ID == ID).FirstOrDefault();
log.LogoutTime = DateTime.Now;
log.Status = 0;
dbContext.SaveChanges();
FormsAuthentication.SignOut();
Session.Abandon();
Session.Clear();
Response.Cookies.Clear();
Session.RemoveAll();
}
return RedirectToAction("Login", "Login");
}
i tried using
return RedirectToAction("Login", "Login");
but it shows me error....
can anyone help me to solve this out..
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Can we display other name of column in MVC view
How to create the a report with filter ,sort and pagination