Yesterday a very small issue put me into the hell for almost an hour. Finally I was able to figure out a workaround for me.
I am not claiming this is the best approach to solve this problem or stuff like that, but definitely it worked for me nice, and I did not find any downside of this yet.
Well, let’s get into the story, I was using the awesome jQuery Autocomplete plug-in inside my ASP.net MVC application. Initially I put this autocomplete textbox into the site.master page and it worked superb! I used the HtmlHelper extension model to accomplish my task. John Zablocki has written a wonderful post regarding this approach. I basically used his approach with subtle modifications. For those who has no idea what jQuery Autocomplete plugin is, it’s a regular html text input control that is registered by the jQuery autocomplete plugin library and when user tries to write something in it, it made an ajax request to the server to get the possible values for the given characters use has been typed. Again, please read the John’s blog for a good idea about this.
Now, from the Index.aspx (I am talking about the Home\Index.aspx -which generates for a hello world ASP.net MVC application), I am rendering this user control using AJAX. And I noticed that the jQuery is not working. Why??