开发者

How can I delay a ASP.NET AutoPostBack so JavaScript fires first?

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 开发者_如何学JAVAthe 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?


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜