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
Yogesh Vedpathak
682
1.4k
188.2k
Getting Null in var obj why ? How to solve This ??
Feb 27 2018 2:59 AM
public ActionResult Login(UserResgitartion objUser)
{
if (ModelState.IsValid)
{
using (MyDatabaseEntities Db = new MyDatabaseEntities())
{
var obj = Db.UserResgitartions.Where(a => a.UserName.Equals(objUser.UserName) && a.Password.Equals(objUser.Password)).SingleOrDefault<UserResgitartion>();
if(obj != null)
{
Session["UserID"]= obj.UserID.ToString();
Session["USERNAME"] = obj.UserName.ToString();
if (objUser.UserName == "Admin" && objUser.Password == "admin")
{
return View("AdminDashBoard");
}
else
{
return View ("UserDashBoard");
}
// return RedirectToAction("UserDashBoard");
}
}
}
return View(objUser);
}
Reply
Answers (
4
)
work with two dropdown control...
Html Content in Page PreRender Event