从另一个页面调用页面方法 [英] call page method from another page

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

问题描述

当我单击iframe中的目录页面时,我的页面具有按钮
我在第2页做了一些工作
单击按钮保存在第2页时需要使用
关闭iframe第2页&&将第2页中生成的值带到第1页上的控件

iam having page that have button when i click that button i dir page in iframe
i do some work on page 2
i need when i click button save in page 2
close iframe page 2 && take the values i generate from page2 to controls on page 1

推荐答案

您需要进一步说明问题..
按照问题的标题,您可以从任何其他页面调用任何页面公共方法.因为页面类是< code>部分类</code>.

但这不是一个好的编程习惯.

例如.
You need to explain your question more..
As per title of question, You can call any pages public methods from any other pages.Because page class are <code>partial classes</code>.

But its not a good programming practice.

for ex.
_Default defaultPage=new _Default();
defaultPage.myPublicFunction();


像这样使用Session

在第2页的按钮中输入:

use Session like this

in the button in page2 write :

Session["Go"] = "the info";
Response.Redirect("~/Default1.aspx");



在page1的PageLoad中写:



in PageLoad in page1 write :

TextBox1.Text =  Session["Go"].ToString();


这篇关于从另一个页面调用页面方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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