在asp.net中使用iframe [英] use of iframe in asp.net

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

问题描述







i在asp.net页面上使用一些iframe我可以从一个传递会话值iframe页面到另一个iframe页面

解决方案

整个项目都可以访问会话值。如果您在一个页面中分配会话值,那么您可以轻松地在另一个页面中使用相同的会话值。

试试这个:

在Page1:(分配会话变量)

会话[  UserID] =   Amit; 



在第2页:(获取会话变量的值)

  if (会话[  UserID]!=  null 
{
TextBox1.Text = Session [ UserID] as string ;
}









--Amit


如果多个帧指向同一站点上的URL,则会自动在它们之间共享会话状态,就像指向同一站点上不同页面的多个窗口一样。但是,你实际上必须明确地使用会话,因为ASP.net的自动回发属性填充等在页面之间不起作用。


Hi,


i am using some iframes on a asp.net page is it possible that i can pass session value from one iframe page to another iframe page

解决方案

Session values will be accessible to throughout the project. If you are assigning the session value in one page then you can use the same session value in another page easily.
Try this:
In Page1:(Assigning the session variable)

Session["UserID"] = "Amit";


In Page2:(Fetching the session variable''s value)

if(Session["UserID"] != null)
{
     TextBox1.Text = Session["UserID"] as string;
}





--Amit


If several frames are pointing at URLs on the same site, then session state will be shared between them automatically, just like it is for several windows pointing at different pages on the same site. You will actually have to explicitly use the session, though, as ASP.net''s automagical postback property population and the like don''t work between pages.


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

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