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.
我在 global.asax 中实现了一个变量,我想在其他控制器中使用它。先感谢您。
如果你的变量是静态的,你可以使用这个 sintax - MvcApplication.VarName。其中 MVCApplication 您的主类继承自 System.Web.HttpApplication,而 VarName - 您的变量名。