当前位置: 首页>>代码示例>>C#>>正文


C# Page.ProcessRequest方法代码示例

本文整理汇总了C#中System.Web.UI.Page.ProcessRequest方法的典型用法代码示例。如果您正苦于以下问题:C# Page.ProcessRequest方法的具体用法?C# Page.ProcessRequest怎么用?C# Page.ProcessRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.Page的用法示例。


在下文中一共展示了Page.ProcessRequest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateFormatter

 public static IStateFormatter CreateFormatter()
 {
     HttpResponse response = new HttpResponse(TextWriter.Null);
     HttpRequest request = new HttpRequest("__token__.aspx", 
         HttpContext.Current.Request.Url.ToString(), "__EVENTTARGET=true&__VIEWSTATEENCRYPTED=true");
     HttpContext context = new HttpContext(request, response);
     
     Page page = new Page();
     page.EnableViewStateMac = true;
     page.ViewStateEncryptionMode = ViewStateEncryptionMode.Always;
     
     page.ProcessRequest(context);
     return new TokenPersister(page).StateFormatter;
 }
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:14,代码来源:RequestValidationToken.cs

示例2: CreateFormatterGenerator

			public static Func<IStateFormatter> CreateFormatterGenerator(bool encrypt, bool sign)
			{
				TextWriter writer = TextWriter.Null;

				HttpResponse response = new HttpResponse(writer);
				HttpRequest request = new HttpRequest("wahha.aspx", HttpContext.Current.Request.Url.ToString(),
					"__EVENTTARGET=true" + ((encrypt) ? "&__VIEWSTATEENCRYPTED=true" : null));
				HttpContext context = new HttpContext(request, response);

				Page page = new Page() {
					EnableViewStateMac = sign,
					ViewStateEncryptionMode = (encrypt)
						? ViewStateEncryptionMode.Always
						: ViewStateEncryptionMode.Never
				};
				page.ProcessRequest(context);
				return () => new TokenPersister(page).StateFormatter;
			}
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:18,代码来源:ModelStateSerializer.cs

示例3: page_lifecycle_test

        private void page_lifecycle_test()
        {
            Page page = new Page();

              MockObject<HttpBrowserCapabilities> mockBrowser = MockManager.MockObject<HttpBrowserCapabilities>(Constructor.NotMocked);
              mockBrowser.ExpectGetAlways("PreferredRenderingMime", "text/html");
              mockBrowser.ExpectGetAlways("PreferredResponseEncoding", "UTF-8");
              mockBrowser.ExpectGetAlways("PreferredRequestEncoding", "UTF-8");
              mockBrowser.ExpectGetAlways("SupportsMaintainScrollPositionOnPostback", false);

              MockObject<HttpRequest> mockRequest = MockManager.MockObject<HttpRequest>(Constructor.Mocked);
              mockRequest.ExpectGetAlways("FilePath", "/default.aspx");
              mockRequest.ExpectGetAlways("HttpMethod", "GET");
              mockRequest.ExpectGetAlways("Browser", mockBrowser.Object);

              MockObject<HttpResponse> mockResponse = MockManager.MockObject<HttpResponse>(Constructor.Mocked);

              HttpContext mockContext = new HttpContext(mockRequest.Object, mockResponse.Object);

              using (StringWriter stringWriter = new StringWriter())
              using (HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter))
              {
            mockBrowser.AlwaysReturn("CreateHtmlTextWriter", htmlWriter);
            page.PreInit +=
              delegate(object sender, EventArgs e)
              {
            // Perform some action
              };
            page.Load +=
              delegate(object sender, EventArgs e)
              {
            // Check/Assert the results of your action
              };
            page.ProcessRequest(mockContext);
              }
        }
开发者ID:butaji,项目名称:Sapphire,代码行数:36,代码来源:UserControlsTests.cs

示例4: 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();
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:37,代码来源:ScriptControlHelper.cs

示例5: CreateFormatterGenerator

				public static Func<IStateFormatter> CreateFormatterGenerator()
				{
					// This code instantiates a page and tricks it into thinking that it's servicing
					// a postback scenario with encrypted ViewState, which is required to make the
					// StateFormatter properly decrypt data. Specifically, this code sets the
					// internal Page.ContainsEncryptedViewState flag.
					var writer = TextWriter.Null;
					var response = new HttpResponse(writer);
					var request = new HttpRequest("DummyFile.aspx", HttpContext.Current.Request.Url.ToString(), "__EVENTTARGET=true&__VIEWSTATEENCRYPTED=true");
					var context = new HttpContext(request, response);
					var page = new Page
					{
						EnableViewStateMac = true,
						ViewStateEncryptionMode = ViewStateEncryptionMode.Always
					};
					page.ProcessRequest(context);

					return () => new TokenPersister(page).StateFormatter;
				}
开发者ID:ehsan-davoudi,项目名称:webstack,代码行数:19,代码来源:CsrfDataSerializer.cs

示例6: Load

 /// <summary>
 /// Loads the specific page.
 /// </summary>
 /// <param name="page">The page which to load.</param>
 public static void Load(Page page)
 {
     HttpContext context = Http.Context;
     Http.ManuallyLoadedPage = page;
     page.ProcessRequest(Http.Context);
 }
开发者ID:davidbetz,项目名称:nalarium.web,代码行数:10,代码来源:PageLoader.cs


注:本文中的System.Web.UI.Page.ProcessRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。