¡@

Home 

c# Programming Glossary: httpcontext

Keeping ASP.NET Session Open / Alive

http://stackoverflow.com/questions/1431733/keeping-asp-net-session-open-alive

IsReusable get return false public void ProcessRequest HttpContext context context.Session Heartbeat DateTime.Now Key is to add..

How do I mock the HttpContext in ASP.NET MVC using Moq?

http://stackoverflow.com/questions/1452418/how-do-i-mock-the-httpcontext-in-asp-net-mvc-using-moq

do I mock the HttpContext in ASP.NET MVC using Moq TestMethod public void Home_Message_Display_Unknown_User_when_coockie_does_not_exist.. var context new Mock HttpContextBase var request new Mock HttpRequestBase context .Setup c c.Request.. HomeController controller new HomeController controller.HttpContext context Here I am getting an error read only . ... my base controller..

How can I upload a file and save it to a Stream for further preview using C#?

http://stackoverflow.com/questions/1653469/how-can-i-upload-a-file-and-save-it-to-a-stream-for-further-preview-using-c

files FileManagerController.GetFilesFromRequest HttpContextWrapper HttpContext if String.IsNullOrEmpty files.ErrorMessage.. HttpContextWrapper HttpContext if String.IsNullOrEmpty files.ErrorMessage files.TotalBytes.. public static FileUploadResultDTO GetFilesFromRequest HttpContextWrapper contextWrapper FileUploadResultDTO result new FileUploadResultDTO..

How do I create a custom membership provider for ASP.NET MVC 2?

http://stackoverflow.com/questions/2771094/how-do-i-create-a-custom-membership-provider-for-asp-net-mvc-2

this.ViewName Error protected void CacheValidateHandler HttpContext context object data ref HttpValidationStatus validationStatus.. validationStatus OnCacheAuthorization new HttpContextWrapper context public override void OnAuthorization AuthorizationContext.. filterContext if AuthorizeCore filterContext.HttpContext SetCachePolicy filterContext else if filterContext.HttpContext.User.Identity.IsAuthenticated..

itextsharp - CSS not getting applied - C# .NET

http://stackoverflow.com/questions/5321779/itextsharp-css-not-getting-applied-c-sharp-net

class styles IHttpHandler public void ProcessRequest HttpContext context HttpResponse Response context.Response Response.ContentType..

How to implement GZip compression in ASP.NET?

http://stackoverflow.com/questions/552317/how-to-implement-gzip-compression-in-asp-net

but it only compresses my .aspx page found it from YSlow HttpContext context HttpContext.Current context.Response.Filter new GZipStream.. my .aspx page found it from YSlow HttpContext context HttpContext.Current context.Response.Filter new GZipStream context.Response.Filter.. context.Response.Filter CompressionMode.Compress HttpContext.Current.Response.AppendHeader Content encoding gzip HttpContext.Current.Response.Cache.VaryByHeaders..

Basic Simple Asp.net + jQuery + JSON example

http://stackoverflow.com/questions/5756147/basic-simple-asp-net-jquery-json-example

public void ProcessRequest HttpContext context context.Response.ContentType application json DateTime..

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated

http://stackoverflow.com/questions/8602395/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation

HttpContext context HttpApplication app 4052053 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS.. IntPtr appContext HttpContext context MethodInfo handlers 191 System.Web.HttpApplication.InitSpecial.. state MethodInfo handlers IntPtr appContext HttpContext context 352 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance..

Force download of a file on web server - ASP .NET C#

http://stackoverflow.com/questions/873207/force-download-of-a-file-on-web-server-asp-net-c-sharp

DownloadHandler IHttpHandler public void ProcessRequest HttpContext context var fileName myfile.sql var r context.Response r.AddHeader..

What is the difference between Server.MapPath and HostingEnvironment.MapPath?

http://stackoverflow.com/questions/944219/what-is-the-difference-between-server-mappath-and-hostingenvironment-mappath

problem was mapping the file path on a server when the HttpContext is not present and I cannot pass a Server variable from Global.asax.. HostingEnvironment.MapPath instead since it doesn't need HttpContext . Are there any situations when these two methods will give..

Redirecting unauthorized controller in ASP.NET MVC

http://stackoverflow.com/questions/977071/redirecting-unauthorized-controller-in-asp-net-mvc

this.ViewName Error protected void CacheValidateHandler HttpContext context object data ref HttpValidationStatus validationStatus.. validationStatus OnCacheAuthorization new HttpContextWrapper context public override void OnAuthorization AuthorizationContext.. filterContext if AuthorizeCore filterContext.HttpContext SetCachePolicy filterContext else if filterContext.HttpContext.User.Identity.IsAuthenticated..

How to produce non-sequential prefix collection indices with MVC HTML Editor templates?

http://stackoverflow.com/questions/11267354/how-to-produce-non-sequential-prefix-collection-indices-with-mvc-html-editor-tem

private static Queue string GetIdsToReuse HttpContextBase httpContext string collectionName We need to use the same sequence of IDs.. key idsToReuseKey collectionName var queue Queue string httpContext.Items key if queue null httpContext.Items key queue new Queue.. queue Queue string httpContext.Items key if queue null httpContext.Items key queue new Queue string var previouslyUsedIds httpContext.Request..

How to implement authorization checks in ASP.NET MVC based on Session data?

http://stackoverflow.com/questions/1151450/how-to-implement-authorization-checks-in-asp-net-mvc-based-on-session-data

and has a valid session object summary param name httpContext param returns returns protected override bool AuthorizeCore.. protected override bool AuthorizeCore HttpContextBase httpContext if httpContext null throw new ArgumentNullException httpContext.. bool AuthorizeCore HttpContextBase httpContext if httpContext null throw new ArgumentNullException httpContext Make sure..

Ninject + MVC3 is not injecting into controller

http://stackoverflow.com/questions/14343388/ninject-mvc3-is-not-injecting-into-controller

HttpContextBase httpContext IController controller IControllerFactory factory 199 System.Web.Mvc... HttpContextBase httpContext AsyncCallback callback Object state 98 System.Web.Mvc.MvcHandler.BeginProcessRequest.. System.Web.Mvc.MvcHandler.BeginProcessRequest HttpContext httpContext AsyncCallback callback Object state 50 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest..

ASP.NET MVC - How to show unauthorized error on login page?

http://stackoverflow.com/questions/1498727/asp-net-mvc-how-to-show-unauthorized-error-on-login-page

override bool AuthorizeCore System.Web.HttpContextBase httpContext _isAuthorized base.AuthorizeCore httpContext return _isAuthorized.. httpContext _isAuthorized base.AuthorizeCore httpContext return _isAuthorized public override void OnAuthorization AuthorizationContext..

URL Routing across multiple subdomains

http://stackoverflow.com/questions/3243045/url-routing-across-multiple-subdomains

public override RouteData GetRouteData HttpContextBase httpContext var url httpContext.Request.Headers HOST var index url.IndexOf.. GetRouteData HttpContextBase httpContext var url httpContext.Request.Headers HOST var index url.IndexOf . if index 0 return..

ASP.NET MVC Authorization

http://stackoverflow.com/questions/329658/asp-net-mvc-authorization

protected override bool AuthorizeCore HttpContextBase httpContext string users Users.Split ' ' if httpContext.User.Identity.IsAuthenticated.. httpContext string users Users.Split ' ' if httpContext.User.Identity.IsAuthenticated return false if users.Length.. return false if users.Length 0 users.Contains httpContext.User.Identity.Name StringComparer.OrdinalIgnoreCase return..

ASP.NET mvc, localized routes and the default language for the user

http://stackoverflow.com/questions/3683404/asp-net-mvc-localized-routes-and-the-default-language-for-the-user

private string _values public bool Match HttpContextBase httpContext Route route string parameterName RouteValueDictionary values..

Is there a way to process an MVC view (aspx file) from a non-web application?

http://stackoverflow.com/questions/3702526/is-there-a-way-to-process-an-mvc-view-aspx-file-from-a-non-web-application

new HomeController using var writer new StringWriter var httpContext new HttpContext new HttpRequest http example.com new HttpResponse.. httpcontext was already set HttpContext.Current httpContext var controllerName controller.GetType .Name var routeData new.. new ControllerContext new HttpContextWrapper httpContext routeData controller var res controller.Index res.ExecuteResult..

Mock HttpContext.Current in Test Init Method

http://stackoverflow.com/questions/4379450/mock-httpcontext-current-in-test-init-method

SetFakeControllerContext this Controller controller var httpContext FakeHttpContext null var context new ControllerContext new RequestContext.. null var context new ControllerContext new RequestContext httpContext new RouteData controller controller.ControllerContext context.. this Controller controller string username var httpContext FakeHttpContext username var context new ControllerContext new..

When `PostAuthenticateRequest` gets execute?

http://stackoverflow.com/questions/5947278/when-postauthenticaterequest-gets-execute

protected override bool AuthorizeCore HttpContextBase httpContext var isAuthorized base.AuthorizeCore httpContext if isAuthorized.. httpContext var isAuthorized base.AuthorizeCore httpContext if isAuthorized var authCookie httpContext.Request.Cookies.. httpContext if isAuthorized var authCookie httpContext.Request.Cookies FormsAuthentication.FormsCookieName if authCookie..

How do I mock the HttpContext in ASP.NET MVC using Moq?

http://stackoverflow.com/questions/1452418/how-do-i-mock-the-httpcontext-in-asp-net-mvc-using-moq

and the general context. c# asp.net mvc mocking moq httpcontext share improve this question HttpContext is read only but..

How does HttpContext.Current work in a multi-threaded environment?

http://stackoverflow.com/questions/1561036/how-does-httpcontext-current-work-in-a-multi-threaded-environment

is scheduling the threads and it has context of which httpcontext needs executing so it finds a thread tells the thread which..

elmah: exceptions without HttpContext?

http://stackoverflow.com/questions/2108404/elmah-exceptions-without-httpcontext

to pick up that exception. c# asp.net exception elmah httpcontext share improve this question Make sure you set your application..

Is there a way to process an MVC view (aspx file) from a non-web application?

http://stackoverflow.com/questions/3702526/is-there-a-way-to-process-an-mvc-view-aspx-file-from-a-non-web-application

HttpContext.Current null throw new NotSupportedException httpcontext was already set HttpContext.Current httpContext var controllerName..

Mock HttpContext.Current in Test Init Method

http://stackoverflow.com/questions/4379450/mock-httpcontext-current-in-test-init-method

I'd appreciate your help. Thanks c# unit testing mocking httpcontext share improve this question HttpContext.Current returns..

Get current System.Web.UI.Page from HttpContext?

http://stackoverflow.com/questions/58123/get-current-system-web-ui-page-from-httpcontext

wrapping conversion or null type conversion. c# asp.net httpcontext share improve this question No from MSDN on HttpContext.Current..

System.Web.HttpContext.Current.User.Identity.Name Vs System.Environment.UserName in ASP.Net/C#

http://stackoverflow.com/questions/8841816/system-web-httpcontext-current-user-identity-name-vs-system-environment-username

Thank you for the answers. c# asp.net c# 4.0 httpcontext system.web share improve this question System.Environment.UserName..

Setting the httpcontext current session in unit test

http://stackoverflow.com/questions/9624242/setting-the-httpcontext-current-session-in-unit-test

the httpcontext current session in unit test I have a web service I am trying.. unit test. In the service it pulls several values from the httpcontext like so m_password string HttpContext.Current.Session CustomerId.. session within the unit test c# web services unit testing httpcontext share improve this question We had to mock HttpContext buy..