|
by: John |
last post by:
I'm trying to create a context object similar to the HttpContext that could
be used by business objects independent of the origin or the call (ASP.NET
or standalone).
So I started out by using ThreadStatic variables to maintain state for the
current request but soon found out that this doesn't work in ASP.NET since
one request can run on more than one thread. I then discovered an article...
|
by: moondaddy |
last post by:
I need to set a variable to a session variable (if that's what you call it)
like this:
dim ds as dataset = HttpContext.Current.Session("CustDataSet")
But I get an exception if this variable in the current session hasn't been
set yet so I need to test it. I tried:
If HttpContext.Current.Session("CustDataSet") = nothing then
HttpContext.Current.Session("CustDataSet") = GetCustDataSet()
|
by: |
last post by:
Today I learned that creating cookies inside of a custom class in ASP.NET
2.0 requires that you prefix it with HttpContext.Current..., e.g. :
HttpContext.Current.Response.Cookies.Add("myNewCookie");
I am wondering if there are any landmines that I should know about, or if
this will work pretty much as I am expecting a cookie should.
|
by: Dave |
last post by:
I'm trying call a couple WebRequests asynchronously using the
QueueUserWorkItem, but one thing I noticed is that the HttpContext is null
within the asynchronous call. I was using HttpContext.Current.Server.MapPath
to load an Xslt file to format and return Xml after the webrequest is made.
Is there a way around this?
Here some code...
stateInfo = new StateInfo(manualEvents, strUrl);
|
by: Aaron Morton |
last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event
from the HttpApplication, if the event is raised after EndRequest then
HttpContext.Current is null. If it is raised before EndRequest (by turning
response buffering off) then HttpContext.Current is set.
To repo add the following to Global.asax
protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
{...
|
|
by: Dave |
last post by:
After some digging, I discovered HttpContext.Current.Session is null
when trying to access a session variable, username, in my upload.cs
code which is in the App_Code folder.
I just determined that I can't because HttpContext.Current.Session is
null. (HttpContext.Current is fine though)
I think there may be another server side method interfering with my
ability to access the session.
|
by: R.A.M. |
last post by:
Hello,
I have created ASP.NET project in which I have a file Admin.cs. It contains
static class Admin with some methods and properties. The problem is that in
property get a reference HttpContext.Current.Session is null, although for
instance HttpContext.Current.Application or HttpContext.Current.Request is
not null:
public static class Admin
{
|
by: alister7 |
last post by:
hi every1
im trying to download a music file from the database SQLserver.which i upload in the database.. The Code below works fine in wen i create a new project of an ASP.Net web application..m using VS 2008
but it gives me an error wen i run the same code in WPF broser APplication(xbap).. it throws an error saying Null reference encountered. the line of error is HTTPcontext context=HTTPcontext.Current;
it goes in the else part of the...
|
by: Madhur |
last post by:
Hello
I am delivering an asp.net 2.0 application to my customer. I need to know,
If I need to check for the condition of HttpContext.Current to be null
in my business logic. I have extensively used Cache and Session objects, and
currently I assume HttpContext.Current object to be existent.
Also, since I do not have this check, some of my unit test cases fail
because there is no HttpContext for them.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|