Click here to Skip to main content
12,828,639 members (46,052 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET jQuery

In my ASP.NET application. I have used JQuery Autocomplete for retrieving database values using Handlers(.ashx).

Now the problem is, i used "UpdatePanel" to avoid flickering on Postback. Now those Autocomplete textbox are lost its JQuery reference on each Postback hence i need to rebind those textbox with the corresponding JQuery reference(From my previous post i got it from an developer).

Reference : How to Enable JQuery Autocomplete textbox inside Gridview with UpdatePanel?[^] [^]

Hence i used the code

<script type="text/javascript">

    $(function () //Object Expected Error here

    var prmInstance = Sys.WebForms.PageRequestManager.getInstance(); //"Undefined variable Sys" error here

    prmInstance.add_endRequest(function () { //"Null reference" error here
        //you need to re-bind your jquery events here

    function initializer()

From the reference :[^]

But i'm getting error "Object Expected" in very first line.

I'm beginner in JQuery.

Any help would be appreciated.
Posted 16-Nov-11 21:12pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

First thing I see is: the argument of jQuery dollar sign function ("$") is some code which looks like a function definition with missing function name.

It's hard to understand what did you mean by that. Maybe, something like
   // Your code here


jkarthick1989 17-Nov-11 2:43am
you are correct...
Now i declare
"$(document).ready(function() {...}" Its works fine..
But now i got error in line

var prmInstance = Sys.WebForms.PageRequestManager.getInstance(); //"Undefined variable Sys" error here
RaisKazi 17-Nov-11 2:46am
Existing syntax will also work by providing reference of latest JQuery.

<script language="javascript" type="text/javascript" src=""></script>
<script type="text/javascript">

$(function ()

jkarthick1989 17-Nov-11 3:15am
ya...thanks for your reply...your are corect

but still i have problem(without errors) in retrieve db values. My autocomplete textbox not shown up...
SAKryukov 17-Nov-11 11:16am
OK, I think it can be a separate problem not seen from the present question; it can be a separate one.
If this particular bug is fixed, please accept the answer formally (green button) -- thanks.
jkarthick1989 22-Nov-11 2:00am
i did..
Oakshan 29-Jul-13 7:48am
Just wanted to say thanks for this code snippet. I was unable to get Jquery to work with an older web forms project that I was given until I pointed the reference to an external web site. It does beg the question of why are my internal links not working though.
Sergey Alexandrovich Kryukov 29-Jul-13 10:18am
You are welcome.
Good luck, call again.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Either you haven't specified the reference of JQuery Or you are using older version of JQuery.

Add below latest JQuery file in your Project and specify it's reference in your Aspx Page.
jkarthick1989 17-Nov-11 3:12am
yes...You are correct

Now its not throw any erors but inside updatePanel my autocomplete textbox remain static :(
Its not shown up the list of db retrieved values....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170326.1 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100