views:

291

answers:

1

I've got an odd situation with a text box and an autocomplete setup on my page. I'm using a JQuery based autocomplete on a text box that has AutoPostBack="True". This works perfect if I use the keyboard to select an autocomplete item, which then fires Jquery to fill in the text box, and then when I tab out of the box the AutoPostBack fires. If, however, I click on an autocomplete item, my text box loses focus first and the AutoPostBack fires before the Jquery has a chance to change the text in my text box. Is there a way to delay either the PostBack or the Jquery so that they don't fight each other? I'm thinking it may have to be the PostBack that gets changed, since the JQuery would lose it's state on the PostBack. Any suggestions?

+3  A: 

Why not remove the ASP.NET autopostback functionality and implement it in JQuery to invoke the post back if/when you want it to post back?

Chris Marisic
I'd agree. Go all out on JQuery.
CResults
That's a good point. I was thinking I wanted to keep them as two separate functions (onclick and onblur, which is what the autopostback gave me). But, that blinded me to the idea of doing the onblur in JQuery. Thanks!
Spencer