Error Creating Control Response Is Not Available In This Context
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “Request is not available in this context” on Masterpage Page's design mode up vote 1 down vote favorite I'm using VS.net 2010 ASP.net C# 4.0 and I've got many pages who use the same Masterpage. But for some reasons I didn't find for now, some pages never display in design mode of Visual Studio. Instead of seeing my designed page, I only see a Gray Square where we can read Error creating control - ContentPlaceHolder1 Request is not available in this context. Anyone know a reason and/or a way to resolve this? Must tell that there's no errors in my whole solution and I can start debbuging normaly. Note : I usualy talk french so feel free to tell me if there's something that wasn't clear! visual-studio-2010 share|improve this question asked Jun 6 '11 at 14:29 Simon Dugré 2,84853565 2 Not sure but this post looks like the same issue you are facing. Take a look. Hope this helps. social.expression.microsoft.com/Forums/en/web/thread/… –Rahul Jun 6 '11 at 14:37 Rahul, write it as an answer. This make my solution working back! –Simon Dugré Jun 6 '11 at 15:02 what in particular on that page fixed your issue? Users might not want to traverse the page for answers since there isn't a marked answer on that page. –Devin Burke Jun 6 '11 at 15:27 I want to let Rahul aswer to give him the "Accepted" answer! But in my case, this is the "Programmer35"'s answer on the page where he said to Remove a letter from the Inherits header, save, add it back and save it back. Then when you open your design mode, it wor
it in the existing framework, I could not see any controls in the designer, and each control was being displayed as a grey box saying Error creating control:
exception is one of the more common errors you may receive on when moving ASP.NET applications to Integrated mode on IIS 7.0. This exception happens in your implementation of the Application_Start http://mvolo.com/iis7-integrated-mode-request-is-not-available-in-this-context-exception-in-applicationstart/ method in the global.asax file if you attempt to access the HttpContext of http://www.allenconway.net/2011/02/workaround-for-vsnet-aspnet-design-tab.html the request that started the application. Update: We recently launched a service that significantly helps you understand, troubleshoot, and improve IIS and ASP.NET web applications. If you regularly troubleshoot IIS errors, manage Windows Servers, or tune ASP.NET performance, definitely check out the demo at www.leansentry.com. The error looks something like this: Server Error in error creating ‘/' Application.
Request is not available in this context Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: Request is not available in this context Source Error: Line 3: { Line 4: HttpContext context = HttpContext.Current; Line 5: String appPath error creating control = context.Request.ApplicationPath; Line 6: } Line 7: Source File: c:inetpubwwwrootglobal.asax Line: 5 Stack Trace: [HttpException (0x80004005): Request is not available in this context] System.Web.HttpContext.get_Request() +3467061 ASP.global_asax.Application_Start(Object source, EventArgs e) in c:inetpubwwwrootglobal.asax:5 [HttpException (0x80004005): Request is not available in this context] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3388766 … This error is due to a design change in the IIS7 Integrated pipeline that makes the request context unavailable in Application_Start event. When using the Classic mode (the only mode when running on previous versions of IIS), the request context used to be available, even though the Application_Start event has always been intended as a global and request-agnostic event in the application lifetime. Despite this, because ASP.NET applications were always started by the first request to the app, it used to be possible to get to the request context through the static HttpContext.Current field. Applications have taken a dependency on this behavior become broken in Integrated mode, which officially decouples Application_Start from the request that starts the application. In the future, we may introduce changes that will further break the assumption that applications start because of requests – for example, by introducing a w2010 using .NET Framework 4.0, and several are upgrades from .NET Framework 3.5 VS.NET 2008 solutions. I rarely use the 'Designer' tab to preview the generated controls of my ASP.NET pages, but in some instances I want to see the wizard of a control for configuration (i.e. Object Data Source Control). Not that there isn't code I couldn't just create by hand, but sometimes it is faster to have the code auto-generated for me. In this case I needed to have the control render in Design view.On this note I will say I am not a big fan of the 'Design' tab to view auto-generated pages. I do not believe VS.NET uses the same rendering engine to show the auto-generated pages as is when the page is rendered in IIS. Therefore early on I found inconsistencies and nuances that showed visual differences between the two (design and run time), so I all but abandoned using the IDE 'Design' view. In fact I think one becomes a more proficient ASP.NET and web developer in general when you can begin to visualize the web pages during coding without needing a 'picture' to see after every line of code is written. Then run the page either in either the local dev server through VS.NET or in IIS to have it render properly, and then use any of the following to break down a page when needed: IE Developer Tools (IE), FireBug Lite (IE or FireFox), Chrome Developer Tools (Chrome).Back to the problem at hand - I noticed that ALL of my pages (content pages of a single simple Master page) show the message "response is not available in this context" for all of my controls when accessing via the design view. I had tried deleting the page from my project, adding a new page, and copying back in the source and code; same error. I also tried cutting out controls 1 at a time, and clicking "Refresh" in the designer but that was n