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
Nizam Nizam
NA
11
4.5k
how to use Session in MVC4
Aug 29 2015 6:00 AM
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login(Login login)
{
if (ModelState.IsValid)
{
var loginOrigin =
db.Logins.FirstOrDefault(s => s.UserName == login.UserName && s.Password == login.Password);
if (loginOrigin != null)
{
SessionValues.Current.Login = new LoginInSession
{
LoginId = loginOrigin.LoginId,
Password = loginOrigin.Password,
UserName = loginOrigin.UserName,
};
return RedirectToAction("CreateDocuments", "Home");
}
//ViewBag.message = "Invalid Username Or Password";
//return View("Login");
}
//ModelState.Clear();
return RedirectToAction("Login");
//return View();
}
Reply
Answers (
5
)
multi table data with stored proc, EF, angularjs, mvc4 curd.
hello sir.