主页面与普通页面不同 [英] Master page different than normal page

查看:118
本文介绍了主页面与普通页面不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行时间的情况下,母版页与普通页面的不同。

如果我请求页面,那么哪个部分将执行第一个母版页或内容部分

How master page is different than normal page in case of execution time.
If i request for for page then which part will execute first master page or content part

推荐答案

就像普通类一样,基类构造函数在任何派生类构造函数之前执行。对于母版页,它们充当内容页面的基页,因此首先执行它们。请参阅此处以获取网页各种组件的确切执行顺序列表: http://stackoverflow.com/questions/4552097/in-what-order-asp-net-master-pages-execute [ ^ ]
Just like a normal class, the base class constructor is executed before any derived class constructor can be. With master pages, they act as the "base page" for your content pages, so they are executed first. See here for a list of exact execution order for the various components of a web page: http://stackoverflow.com/questions/4552097/in-what-order-asp-net-master-pages-execute[^]


请参考此链接。 母版页/内容页面中的活动 [ ^ ]



它表明,当最终用户在浏览器中请求内容页面时,事件排序如下:



主页子控件初始化:首页中包含的所有服务器控件都是首次初始化。

内容页面子控件初始化:内容页面中包含的所有服务器控件都已初始化。

母版页初始化:母版页本身已初始化。

内容页面初始化:内容页面已初始化。

内容页面加载:内容页面已加载(这是Page_Load事件,后跟Page_LoadComplete事件) 。

主人页面加载:加载母版页(这也是Page_Load事件)。

母版页子控件加载:母版页上的服务器控件是加载到页面上。

内容页面子控件加载:内容页面上的服务器控件被加载到页面上。



这也很有用。



ASP.NET主页和内容页面中的事件 [ ^ ]



问候......:笑:
Refer to this link. Events in Master page / Content Pages[^]

It states that,When an end user requests a content page in the browser, the event ordering is as follows:

Master page child controls initialization: All server controls contained within the master page are first initialized.
Content page child controls initialization: All server controls contained in the content page are initialized.
Master page initialization: The master page itself is initialized.
Content page initialization: The content page is initialized.
Content page load: The content page is loaded (this is the Page_Load event followed by the Page_LoadComplete event).
Master page load: The master page is loaded (this is also the Page_Load event).
Master page child controls load: The server controls on the master page are loaded onto the page.
Content page child controls load: The server controls on the content page are loaded onto the page.

This can also be useful.

Events in ASP.NET Master and Content Pages[^]

Regards..:laugh:


这篇关于主页面与普通页面不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆