【发布时间】:2012-03-31 22:08:26
【问题描述】:
我有常用功能,我将其折叠在 Scripts 文件夹中的 CommonFunctions.js 上。
我将它包含在我的母版页中并在我的页面上使用它。当我在页面上回帖时,我的功能不起作用。
我的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 () {
});
});
}
});
【问题讨论】:
-
你在做部分回发吗?我的意思是使用条件回发更新面板?
-
只是为了确认:这正是您使用的代码吗?我看到一个对“gf”函数的调用,但声明了一个“gF”函数。别忘了 JS 是区分大小写的
-
是的,我使用更新面板。当我在页面上使用
-
对不起,我在那里手动写的。编辑它。
标签: c# jquery asp.net postback