Questions tagged [httpcontext]

HttpContext is a class from .NET Framework which provides information about an HTTP request.

HttpContext is a class from .NET Framework which provides information about an HTTP request.

1127 questions
0
votes
1 answer

HttpContext session within a custom class is always null

I'm trying to access a session variable inside a custom class like so: Controller: public void RemoveMachinesListChanged(object sender, RemovePackageEvent e) { PackageActionStatus.Current.Machines = e.Machines; //…
ShaneKm
  • 20,823
  • 43
  • 167
  • 296
0
votes
1 answer

HttpResponse when trying to make cookie in C#

error is: The name 'Response' does not exist in the current context when i try to use Response.Cookies.Add(cookie); I'm not sure what else should I need to include to get it work. I making app where user can login and when they login cookie is…
Misko Mali
  • 617
  • 1
  • 7
  • 17
0
votes
1 answer

Asp.net : HttpApplication context authentication for aspx page gets called infinite times and page never loads

I have an asp.net web application that performs some license checks before calling up the login page... if the product is not licensed then it navigates to a abc.aspx page with some error details. This license check is an HttpModule which is…
Kartikkumar Rao
  • 171
  • 2
  • 18
0
votes
2 answers

WebConfigurationManager or HttpContext.Application?

I'm a beginner with C#, .net etc., and I am working with a MVC Web Application. I saw some examples where, in Application_Start() in Global.asax.cs, people use Application.Add("prop", "value") to store values from Web.config. Then we can access it…
Jo Pango
  • 474
  • 1
  • 5
  • 15
0
votes
1 answer

HttpContext.Current.Session with load balancing

I'm observing a weird situation, and I'm hoping someone has some insight. It's not an ideal situation (trying to support legacy stuff). What I'm observing is illustrated in this example: I've got one server in my load balanced server pool. In an…
Yoh Suzuki
  • 1,435
  • 2
  • 11
  • 15
0
votes
1 answer

C# problems with HTTPContext.request.params and HTTPContext.request.params.get()

I hope that someone could help me with the following problem because I'm really lost. I get a C# HttpContext from an ajax javascript call into a C# Handler. Then, running debug mode with VS I can see that the context.Request.Params return the…
Ludo
  • 3
  • 1
  • 3
0
votes
1 answer

Keeping in (http)context over multiple modules

I have a class with static functions which need to use the current HttpContext. Instead of sending the object each time I use these functions, I tried a different approach. I built such a property: private static HttpContext _http; private static…
JNF
  • 3,696
  • 3
  • 31
  • 64
0
votes
3 answers

Unit testing code that relies on a SessionManager class with a dependency on HttpContext.Current

I have a SessionManager class in an existing application that looks like this: public class SessionManagerBase { public static void AddItem(TKey key, object item) { _httpContext.Session[key.ToString()] = item; } public…
Scott
  • 13,735
  • 20
  • 94
  • 152
0
votes
2 answers

ASP.NET Session is not keeping stored across pages

First, I created a Login page that added a key value pair to the session and verified that on that page the session holds that pair. Next, I attempt to go to another page that looks for that pair in the session and it is not there. I've put the…
Matthew Zuhlsdorf
0
votes
0 answers

LDAP Authentication failed. Could that be due to change in domain?

I could login to a web application when i was under the domain "X" but recently migrated to "y". But my VS.Net 2003 code doesn't do anything to verify the domain. As long as i'm registered with the database, it takes me in. I'm really surprised…
CodeMad
  • 950
  • 2
  • 12
  • 30
0
votes
1 answer

Get querystring value

I want to make a method in my tools library that request the querystring from the url. I created the following code, but i can't use the HttpContext in a class library. public string RequestString(string requestParam, string Default) { …
Justin
  • 33
  • 1
  • 3
0
votes
3 answers

Multi-Threading, HttpContext, Long Running Task?

I got started with threads Thread.Start() recently and Long Running Tasks and noticed several request related issues. EDIT What would you suggest to provide the user a feedback while the job is being processed, make efficient use of the thread pool…
maxbeaudoin
  • 6,546
  • 5
  • 38
  • 53
0
votes
1 answer

SignalR - Push notifications to Silverlight from outside Http context

I'm new to SignalR and am trying send push notifications to a Silverlight client. Our web project is NOT Asp.Net MVC - just ASP.NET. I have created a simple Hub class: [HubName("ServerHub")] public class ServerHub: Hub { public Task…
Alberto
  • 333
  • 2
  • 16
0
votes
1 answer

Displaying custom message in login page when redirected by `AuthorizeAttribute`

I have written a custom AuthorizeAttribute to display message in the login page. Here is the code. public class MyAuthorizeAttribute : AuthorizeAttribute { public string Message { get; set; } protected override bool…
Mohayemin
  • 3,841
  • 4
  • 25
  • 54
0
votes
2 answers

Session variables don't store with Internet Explorer 9

I am trying to pass a session variable from one page to another using this code in asp.net: HttpContext.Current.Session["FacebookID"] = id; This works just fine with Firefox and Chrome, but when I try to grab that value from another page in…
Meyer Denney
  • 796
  • 1
  • 11
  • 34