TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dheeraj Sharma
NA
98
29.1k
how to redirect page in string method(MVC)
Jan 3 2018 12:21 AM
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..
Reply
Answers (
3
)
Can we display other name of column in MVC view
How to create the a report with filter ,sort and pagination