hey,
i’m using the Facebook style autoComplete inside a asp.net ajax update panel,
by problem is when im doing a postback to the UpdatePanel the Jquery Disapear,
Any Idead?
thanks,
Code:
$(document).ready(function () {
$("[id$='DDL_Guests']").fcbkcomplete({
json_url: "../../Search.asmx/SearchAC",
cache: false,
filter_case: false,
filter_hide: true,
firstselected: true,
onremove: RemoveItem,
onselect: AddItem,
filter_selected: true,
maxitems: 10,
newel: true
});
});
When a partial postback occurs it update your markup and so the element with ID
DDL_Guestswill not be anymore binded to the jQuery code you are using the first time the page load.So you need to rebind your jQuery code after a partial postback event has occurred.
To solve this problem you have to add an
endRequestevent handler in your code and call a function that will rebind again the widget to theDDL_Guestselement as in the following codeThen simply call the
loadfunction from your body markupusing this trick your jQuery code inside the
jQueryInit()function get binded the first time the page load through the$(document).ready(function () {}and get rebinded again after a partial page postback caused by the UpdatePanelHope it helps