c# - 是否首先调用母版页?

标签 c# asp.net .net master-pages

我假设这是真的,但想提出这个问题。母版页是在 ASP.NET 中首先执行,还是正在检索的页面?

我问是因为我想在母版页中完成一些处理,其结果被加载到一个静态对象中,然后可以被调用的页面使用(例如用户数据)

最佳答案

抱歉只是引用,但我不知道要添加什么:

Individual ASP.NET server controls have their own life cycle that is similar to the page life cycle. For example, a control's Init and Load events occur during the corresponding page events.

Although both Init and Load recursively occur on each control, they happen in reverse order. The Init event (and also the Unload event) for each child control occur before the corresponding event is raised for its container (bottom-up). However the Load event for a container occurs before the Load events for its child controls (top-down). Master pages behave like child controls on a page: the master page Init event occurs before the page Init and Load events, and the master page Load event occurs after the page Init and Load events.

http://msdn.microsoft.com/en-us/library/ms178472.aspx

enter image description here

关于c# - 是否首先调用母版页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10505350/

相关文章:

c#线程访问其他线程

c# - 无法在 asp.net core web API 6.0 中获取环境变量

java - Akka:DeathPactException 总是编程错误吗?

c# - 我应该通过返回 null 来处理开发人员失败还是抛出自定义异常

c# - 当基本词以 I 开头时,如何命名接口(interface)?

c# - 调用 Windows 资源管理器外壳扩展

c# - 自动更新 C# 程序

c# - 非静态字段、方法或属性需要对象引用 'System.Web.UI.Page.Server.get'

javascript - 使用 Javascript 删除 Gridview 行

html - 即使 url 是新的,浏览器也不会下载更新的 css、js 等