本文整理匯總了C#中System.Web.UI.Page.AttachPageModules方法的典型用法代碼示例。如果您正苦於以下問題:C# Page.AttachPageModules方法的具體用法?C# Page.AttachPageModules怎麽用?C# Page.AttachPageModules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Web.UI.Page
的用法示例。
在下文中一共展示了Page.AttachPageModules方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CheckOnlyRenderSelf
/// <summary>
///
/// </summary>
/// <param name="ctr"></param>
/// <param name="renderMode"></param>
public static void CheckOnlyRenderSelf(Control ctr, ControlRenderMode renderMode)
{
if (renderMode.OnlyRenderSelf && renderMode.UseNewPage && ctr.Page.Items[PageExtension.PageRenderControlItemKey] != ctr)
{
Page currentPage = ctr.Page;
ctr.Parent.Controls.GetType().GetMethod("SetCollectionReadOnly", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(ctr.Parent.Controls, new object[1] { null });
Page page = new Page();
PageRenderModePageCache currentPageCache = PageRenderModeHelper.GetPageRenderModeCache(currentPage);
PageRenderModePageCache pageCache = PageRenderModeHelper.GetPageRenderModeCache(page);
SetPageLevel(pageCache, GetPageLevel(currentPageCache) + 1);
string currentPageUniqueID = GetPageUniqueID(currentPageCache);
if (currentPageUniqueID != string.Empty)
currentPageUniqueID += ",";
SetPageUniqueID(pageCache, string.Format("{0}{1}", GetPageUniqueID(currentPageCache), ctr.UniqueID));
page.AppRelativeVirtualPath = ctr.Page.AppRelativeVirtualPath;
page.EnableEventValidation = false;
InitNewPageContent(page, ctr);
page.AttachPageModules();
page.ProcessRequest(HttpContext.Current);
HttpContext.Current.Response.End();
}
}