Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2004, 01:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default HttpContext and Context

Hello,

I was just curious if anybody knew the reason sometimes you refer to the corrent context as HttpContext.Current, and sometimes it is Context.Current. As an example, I'm building a class outside of the web application, and it worked using Context but not HttpContext.

Is HttpContext specified in the web domain only, and context is used elsewhere?

Just curious.

Brian
__________________
Brian
 
Old September 23rd, 2004, 11:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Brian,

Chances are what you are seeing is just a side effect of the code scope.

When you are in a web application, you'll typically be coding on a page (System.Web.UI.Page). "Context" is a member of "System.Web.UI.Page". Outside of the scope of a page class, you can only see it be means of the static reference via "System.Web.HttpContext.Current".

Not sure if you have them backwards in your post or not, but this is what I have found to be the case.
 
Old September 23rd, 2004, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I have a web control library, that has a class that inherits from System.Web.UI.Control; I managed to get it to work with Context.Current.

I figured that was it, but wasn't sure....

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Storing data in HttpContext, concurrency issue jlrolin ASP.NET 2.0 Professional 0 March 30th, 2008 06:25 PM
Unable to set context in web.xml or context.xml. dchicks Apache Tomcat 1 March 7th, 2008 07:59 AM
HttpRuntime vs HttpContext r_adarsh .NET Framework 1.x 1 February 19th, 2008 10:50 AM
Error - context As HttpContext not defined netasp BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 28th, 2005 11:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.