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
boycoto
NA
147
125.9k
Searching Record in ASP.NET MVC (EF)
Dec 1 2012 3:14 AM
I'm trying to search a record but nothing is happen. Can anyone help me with this.
SignUp Controller
[code]
public ActionResult SearchUser(string userName)
{
var users = _SignUp.All()
.Select(user => new
{
userName = user.userName,
firstName = user.firstName,
middleName = user.middleName,
lastName = user.lastName
}
)
.Where(w => w.userName == userName)
.ToList();
return View(users);
}
[/code]
In my Index.cshtml
[code]
@model IEnumerable<mvcTraining.Data.ViewModel.UsersList>
@using (Html.BeginForm("SearchUser"))
{
<div>Enter Username to search:</div>
<input type="text" id="txtUsername" value="" />
<input type="submit" value="Search User" />
}
[/code]
Reply
Answers (
1
)
checkchanged problem
LinqToSql in ASP.NET