在我的web应用程序中,我使用jquery对话框来打开弹出窗口。 用于执行此任务的功能是这样的:关闭jQuery对话框后会话过期
function OpenPopup(popupTarget, width, height, params, onOpenFunction, onCloseFunction, popupElement){
// some code to parse the parameters
//`popupElement` is a div with `style="display: none;"`
// included in a master page which every page inherits from
$(popupElement).dialog(
{
autoOpen: false,
resizable: false,
height: height,
width: width,
modal: true,
open: onOpenFunction,
closeOnEscape: false,
close: function (e)
{
var popupResult = $(this).dialog("option", "notification");
$(this).dialog("destroy");
if (!isHTMLElement)
popupFrame.css("visibility", "hidden");
if (jQuery.isFunction(onCloseFunction))
{
var funct = eval(onCloseFunction);
funct(popupResult);
}
}
});
$(popupElement).dialog("open");
}
这是调用上述方法的功能:
function FiltroNotifiche(){
params = "";
OpenPopup("~/manage/Popup/FiltroNotifiche.aspx", 450, 350, params, function (e) { }, function (strNotification)
{
OnPopupReturn(true, strNotification, function()
{
__doPostBack('UpdatePanel', 'Filtro=true');
});
});
}
function OnPopupReturn(bRefresh, strNotification, senderFunction){
// this function parses strNotification and if, successful, calls:
var funct = eval(senderFunction);
funct();
}
我使用ICallbackEventHandler
回调接口的弹出里面。
问题是,在打开和关闭弹出窗口(我可以看到正在执行的回调和所有的)之后,无论我下一步做什么,我都会被踢出去,很可能是因为会话已过期。
,我注意到一个奇怪的是,这种情况仅如果我得到该通过菜单控制打开弹出式(GestioneNotifiche.aspx),因为如果我到那里通过另一个网页上的按钮一项PostBackUrl页面,这不会发生,并且会议愉快地生活!
菜单上有一个XML数据源,这些绑定:
<DataBindings>
<asp:MenuItemBinding DataMember="Menu" TextField="Text" Selectable="false" />
<asp:MenuItemBinding DataMember="MenuItem" NavigateUrlField="NavigateUrl" TextField="Text" ValueField="Value" />
</DataBindings>
这是菜单项:
<MenuItem Value="" Text="Gestione notifiche" NavigateUrl="~/manage/GestioneNotifiche/GestioneNotifiche.aspx" />
我也注意到呼叫通过菜单有Request.HttpMethod = "GET"
,同时通过回发它(很明显)"POST"
。这可能是重要的吗?我对GET和POST的区别并不十分了解。
谢谢
什么让你觉得会话实际上到期了。被“踢出”后,你能回到地址并使用调试,检查会话是否包含你期望它包含的变量? – 2012-02-07 12:29:43
随着“踢出”我的意思是我被重定向到我的应用程序的登录页面;我不能简单地输入地址并再次加载页面 – Piddu 2012-02-07 12:42:32
,因此您的身份验证似乎已被清除......而不是会话。在page_load中是否有一些代码用于确定用户是否已通过身份验证,如果不是,则重定向?如果是这样,请粘贴进去。 – 2012-02-07 13:06:44