如何从1个aspx页面调用一个函数到另一个 [英] how to Call a function from 1 aspx page to another

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

问题描述

我想调用一个在a.aspx中定义的函数,现在我
想从b.aspx中调用它
我该怎么办??
任何帮助表示赞赏
非常感谢....

I want to call a function which is defined in say a.aspx and now I
wanted to call it from b.aspx
How can I do this???
Any help appreciated
many thanks....

推荐答案

更好的实现是使用nTier设计并将通用方法分离为业务层对象,可以从这两个对象中调用必要的页面
A much better implementation would be to use a nTier design and seperate the common method into a business layer object that could be called from either page as necessary


如果要实现全局方法,则需要执行以下操作之一:

0)创建一个基类,并在所有适当的aspx页面中继承该基类. (首选方法)

1)创建一个静态类,并将其放在那里.

如果需要访问多个页面中的数据,则应将其粘贴在Session变量中.
If you want to implement global methods, you need to either:

0) Create a base Page class and inherit that base page class in all appropriate aspx pages. (preferred method)

1) Create a static class and put them there.

If you need access to data in more than one page, you should stick it in a Session variable.


创建一个类X,其中包含您想要的常用功能
喜欢..

X级
{
//功能
}

您可以在两个页面中都创建此类的对象,并且可以轻松地在该类中调用函数...

希望!会有所帮助的.. ::)
create a class X which contains the common functions u wants
like..

class X
{
//functions
}

you can create object of this class in both the pages and can call functions inside that class easily...

Hope! it will help.. :)


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

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