ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Controller not getting called when setting up in a new project
Title:
B
I
{code}
?
I recently started on working with asp.net , i found the examples here were great to start . Everything works fine when I just down load the zip and work from the solution . I am running into problems when using it in my solution/project . I followed the instructions to set it up on my project . But when I want to test the simplest piece of the code ( say Auto Complete from my project , i see that the controller is even not getting called .everything complies and I am its justa run time issue . Let me know what I am missing . Here is my code View: Meal: @(Html.Awe().AutocompleteFor(o => o.Meal) .Url(Url.Action("GetItems", "CaseSearch")) .Placeholder("try o")) Controller: public class CaseSearchController : Controller { public ActionResult GetItems(string v)// v is the entered text { Debug.WriteLine("GridGetItems"); /*v = (v ?? "").ToLower().Trim(); var items = Db.Meals.Where(o => o.Name.ToLower().Contains(v)); return Json(items.Take(10).Select(o => new KeyContent(o.Id, o.Name)));(*/ return Json(""); } } I was not sure how to debug this , so just commented out every line in the method and just wanted to see the print to make sure the call is being invoked when i tried to key in o . But nothing happens.
Save Changes
Cancel
Guesswhat
asked at 16 Jan 2019
the code looks correct, GetItems should return a Json from collection of `KeyContent` but it should still be hit if you put a breakpoint in there, you can check if you have any errors in the browser console
at 17 Jan 2019
Omu
Breakpoint not getting hit and no errors on browser window . As I told you if I replace that awesome code with some dummy code I write on that page it’s getting called . My guess is somewhere my run time configuration of awesome dependent libraries is not getting called . Is there using some simple java script I can test is the awesome libraries loaded ?
at 17 Jan 2019
Guesswhat
you can try in the console `awe.flash($('body'))` or simply type `awe` and see if it has value; try going through the installation steps one more time
at 17 Jan 2019
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