I have common functions and I collapse it on CommonFunctions.js
in Scripts folder.
I include it on my master page and use it on my pages. When I do any post back on a page, my function doesn't work.
My CommonFunctions.js
:
$(function () {
gf();
if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
gf();
}
function gf(){
$('.AddNewGeneralPanel').click(function () {
if ($(this).find('.AddNewGeneralPanelStyle').text() == "") {
$(this).find('.AddNewGeneralPanelStyle').text("( Gizle )");
lastOpenId = $(this).attr("codeid");
}
else
$(this).find('.AddNewGeneralPanelStyle').text("");
$(this).next('.AddNewGeneralAccordionDiv').slideToggle('slow', function () {
});
});
}
});