在Safari中调用iframe中的pageMethods [英] Calling pageMethods in an iframe, in Safari

查看:96
本文介绍了在Safari中调用iframe中的pageMethods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我现在谷歌搜索了5个小时,我变得疯了......如果有人有想法它应该很棒。

我正在使用我的asp c#页面中的页面方法如下:



[WebMethod]

[System.Web.Script.Services.ScriptMethod]

公共静态字符串GetUrl(string idSession)

{

string IdStructureString = System.Web.HttpContext.Current.Session [idstructure]。ToString ();

......东西......



}

每件东西都运转良好但是当1 /使用Safari(默认选项:不启用第三方),当在iframe中调用2 /我的页面时(另一个域中的主页面)System.Web.HttpContext.Current.Session为null且未完成任何操作。



似乎Safari不会在被叫iframe中启用cookie,因为用户与之交互 - >无法检索会话变量(在我的例子中,webuser与之交互)

奇怪的是,在我的page_Load或其他经典方法中,会话变量是正确填充的,但在我的webmethod内部时却没有。

我一直在使用3P策略或尝试其他策略,但没有任何工作。有什么想法吗?



非常感谢!

Hello,
I've googling for 5 hours now and i become mad... if anyone have a idea it should be great.
I'm using page method in my asp c# pages like this :

[WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string GetUrl(string idSession)
{
string IdStructureString = System.Web.HttpContext.Current.Session["idstructure"].ToString();
... stuff ...

}
every thing is working fine but when 1/ using Safari (with default options: not enable third party) and when 2/ my page is called in an iframe (main page in another domain) System.Web.HttpContext.Current.Session is null and stuff is not done.

It seem that Safari don't enable cookies in a called iframe since user interact with it -> can't retrieve session variables (in my case, webuser interact with it)
The strange is that in my page_Load or other classics methods, session variables are correcty filled but not when inside my webmethod.
I've been working with 3P policies or made others tries but nothing is working. Any idea ?

Thanks a lot !

推荐答案

这篇关于在Safari中调用iframe中的pageMethods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆