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
tvv
NA
4
7.5k
How to do Autocomplete Textbox in MVC2?
Feb 12 2014 5:17 AM
<%= Html.TextBox("SearchString")%>
JQuery:
$(function () {
$("#SearchString").autocomplete({
source: "/JsonData/getData",
minLength: 1,
select: function (event, ui) {
if (ui.item) {
$("#SearchString").val(ui.item.value);
$("form").submit();}}});
})(jQuery);
i added
jquery-ui-1.8.11.js
and
jquery-ui-1.8.11.min.js
json:
public JsonResult getData(string searchstring)
{
var set = (from a in CMS.StudentRegistrations select a.RollNumber);
var namelist = set.Where(n => n.ToLower().StartsWith(searchstring.ToLower()));
return Json(namelist, JsonRequestBehavior.AllowGet);
}
autocomplete textbox is not working for me. any body say me the solution . VS2010,MVC 2 only i used. Thanks in advance
Reply
Answers (
1
)
my pop up in websity is not poping up up ,
mvc ajax request using jquery and knockouts