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
Mahendra Kumar
NA
164
5.4k
The name ViewBag does not exist in the current context
Dec 28 2018 3:32 AM
[HttpPost]
public ActionResult Index(tblUser ob)
{
if (ob.emp_no != null && ob.pass != null && ob.pass != "")
{
if (ModelState.IsValid)
{
billMangeSys_Entities billentity = new billMangeSys_Entities();
var user = billentity.tblUsers.Single(x => x.emp_no == ob.emp_no && x.pass == ob.pass);
if (user != null)
{
// return View(user);
return RedirectToAction("dashboard");
}
}
}
else {
ViewBag.Message = string.Format("Hello {0}.\\nCurrent Date and Time: {1}", name, DateTime.Now.ToString());
}
return View();
}
Reply
Answers (
3
)
Set color through color ASCII code
redirect to another page if page reloaded 2nd time