ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Issue using Autocomplete component
Title:
B
I
{code}
?
Hello, I am trying to use awesome Autocomplete component. I am not able to pass the text entered in the placeholder to the controller method. Here is my code. @Html.Awe().AutocompleteFor(model => model.NEChannel).Placeholder("NE").Controller("GetData").CssClass("form-control") Controller method: public ActionResult GetItems(string parent)// v is the entered text { var channelList = new ArrayList(); AoSession aoSession = null; aoSession = SCcon.Con_NameService(); channelList = GetDataHelper.ChannelList(parent, aoSession); items = channelList.Where(o => o.Name.ToLower().Contains(v)); return Json(items.Take(10).Select(o => new KeyContent(o.Id, o.Name))); } The string parent is coming as NULL. Please explain what is wrong here, I am not proceed in my implementation with this issue. Immediate help is appreciated. Thanks.
Save Changes
Cancel
test
asked at 28 Jul 2016
v is the entered text, you don't need parent, because you don't have .Parent; follow this demo http://aspnetawesome.com/learn/mvc/Autocomplete
at 28 Jul 2016
Omu
Great ! Thank you.
at 28 Jul 2016
test
@Html.Awe().AutocompleteFor(model => model.NEChannel).Placeholder("NE").Parent("TestFIName").Controller("GetData").CssClass("form-control"). Can I add a parent like this? Will it work ! As of now I tried and I get null for the parent value.
at 28 Jul 2016
test
Works fine, I used string testId instead of string parent in controller method. Thanks again.
at 28 Jul 2016
test
http://aspnetawesome.com/learn/mvc/General#Binding-to-Parents
at 28 Jul 2016
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK