System.Web.HttpServerUtility.Execute C# (CSharp) Method

Execute() private method

private Execute ( string path, TextWriter writer, bool preserveForm, bool isTransfer ) : void
path string
writer System.IO.TextWriter
preserveForm bool
isTransfer bool
return void
		void Execute (string path, TextWriter writer, bool preserveForm, bool isTransfer)
		{
			if (path == null)
				throw new ArgumentNullException ("path");

			if (path.IndexOf (':') != -1)
				throw new ArgumentException ("Invalid path.");

			string queryString = null;
			int qmark = path.IndexOf ('?');
			if (qmark != -1) {
				queryString = path.Substring (qmark + 1);
				path = path.Substring (0, qmark);
			}

			string exePath = UrlUtils.Combine (context.Request.BaseVirtualDir, path);
			bool cookieless = false;
			
#if NET_2_0
			SessionStateSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/sessionState") as SessionStateSection;
			cookieless = SessionStateModule.IsCookieLess (context, config);
#else
			SessionConfig config = HttpContext.GetAppConfig ("system.web/sessionState") as SessionConfig;
			cookieless = config.CookieLess;
#endif
			if (cookieless)
				exePath = UrlUtils.RemoveSessionId (VirtualPathUtility.GetDirectory (exePath), exePath);
			
			IHttpHandler handler = context.ApplicationInstance.GetHandler (context, exePath, true);
			Execute (handler, writer, preserveForm, exePath, queryString, isTransfer, true);
		}

Same methods

HttpServerUtility::Execute ( IHttpHandler handler, TextWriter writer, bool preserveForm ) : void
HttpServerUtility::Execute ( IHttpHandler handler, TextWriter writer, bool preserveForm, string exePath, string queryString, bool isTransfer, bool isInclude ) : void
HttpServerUtility::Execute ( string path ) : void
HttpServerUtility::Execute ( string path, TextWriter writer ) : void
HttpServerUtility::Execute ( string path, TextWriter writer, bool preserveForm ) : void
HttpServerUtility::Execute ( string path, bool preserveForm ) : void

Usage Example

Example #1
0
 public override void Execute(string path)
 {
     w.Execute(path);
 }
All Usage Examples Of System.Web.HttpServerUtility::Execute