由网友(南笙北执)分享简介:我们正在开发一个网站 CMS 的文件推到我们的生产服务器中。如果 .apsx 页面创建共享隐藏文件相同的code,这将导致一个问题?We are developing a site inside a CMS that pushed files to our production server. If the .aps...
我们正在开发一个网站 CMS
的文件推到我们的生产服务器中。如果 .apsx
页面创建共享隐藏文件相同的code,这将导致一个问题?
We are developing a site inside a CMS
that pushed files to our production server. If the .apsx
pages created share the same code behind file, will this cause a problem?
推荐答案
为什么你不让这两个页面来自同一个类继承?
Why don't you let both pages inherit from the same class?
public class MyPage : System.Web.UI.Page
{
// common logic that both pages should have
protected void Page_Load(object sender, EventArgs e)
{
}
}
public partial class PageA : MyPage
{
// specific logic for page A
}
public partial class PageB : MyPage
{
// specific logic for page B
}
相关推荐
最新文章