Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以访问其他页面上的方法吗?IE 使用 Mainpage 类中 SecondPage 类中的方法?或者有没有办法使方法全局化(即跨越所有页面的方法)?
刚刚找到解决问题的方法,把你想用的方法做成PUBLIC STATIC方法,然后如果你想在另一个页面上使用这些方法,就加go
NamespaceName.PageName.MethodName( var Args );
您应该使用公共静态方法
这是一个不好的方法,你可以做一个服务类