Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
obj getting value null but when Debugg Line It Showing value
Yogesh Vedpathak
Jan 11 2018 4:55 AM
91
Reply
// Getting Null but during debugging it show me value of Username and password but not traversing value to var obj ...
var obj = Db.UserProfiles.Where(a => a.UserName.Equals(objUser.UserName) && a.Password.Equals(objUser.Password)).FirstOrDefault();
public ActionResult Login(UserProfile objUser)
{
{
if(ModelState.IsValid)
{
using (SessionEntities Db = new SessionEntities())
{
var obj = Db.UserProfiles.Where(a => a.UserName.Equals(objUser.UserName) && a.Password.Equals(objUser.Password)).FirstOrDefault();
if (obj != null)
{
Session["UserId"] = obj.UserId.ToString();
Session["UserName"] = obj.UserName.ToString();
return RedirectToAction("UserDashBoard");
}
}
return View(objUser);
}
else
{
return RedirectToAction("Login");
}
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How To get Harddrive Information in Multiple Remote Desktop?
click fuction is not working properly Please check & revert