我在文件中有一个文件,App_Code
它是一些遗留代码,用于控制登录和会话。理想情况下,一旦我登录,我希望更新 ..Master.cs 以触发更新布局的功能(某些面板,启用等)。
我可以App_Code
从 Code Behind 轻松访问,尽管我无法弄清楚如何反过来执行此操作。
MasterPage.master.cs(后面的代码)
public static class MasterPage : System.Web.UI.MasterPage{
...
public static void LogInCB{
//stufff
}
...
}
App_Code (something.cs)
public static string(){
//Master.LogInCB(); -tried
//System.Web.UI.MasterPage.LogInCB(); -tried
return something;
}
我很高兴接受有关此问题的官方 MS 文档的链接。