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

Testing a class library that is using different databases based on Session

I have an ASP.NET website project that until recent had all code in App_Code folder. It uses Entity Framework 4 as ORM. Application is divided into three "sections" (let's say one for each customer). Each section has it's own database (but same…
Episodex
  • 4,479
  • 3
  • 41
  • 58
0
votes
1 answer

mvc3 httpcontext in models

I currently reference HttpContext in my models. Is this good practice? Should I just pass in information I need instead? For example, in my model code: public void function() { string param = HttpContext.Current.Request.QueryString["param"]; …
River
  • 1,487
  • 3
  • 15
  • 25
0
votes
1 answer

Current.Request.Files.Count == 0

I am writing the c# component of a .aspx page which an external site will be sending XML to. My page needs to be able to receive the XML and parse it, but I am getting hung up on receiving the XML. My page is getting hit with the XML page, but…
0
votes
1 answer

What is the difference between storing data in a session or the httpcontext object

I'm building a MVC3 application that needs to store secure user information such as userid, username, phone, and email. In my research I see people using the httpcontext object as well storing user objects in session state. Session["User"] = user;…
0
votes
0 answers

HttpContext.Current.Items being stepped on? Data scoped in a request

I'm working on a REST API built with WCF WebApi Preview 6. This is for a multi-tenant application and consumed by different clients (web and mobile applications). There are certain resources on this API that requires authentication in order to…
Raciel R.
  • 2,136
  • 20
  • 27
0
votes
2 answers

Issues with HttpContext.Current.Response.Redirect in a class

I have written a class which gets the post data using jquerypost and then perform some crud operations. Its works fine adding stuff to the database , but it doesnt redirects to the page when passing certain data , below is the code : …
Mr A
  • 6,448
  • 25
  • 83
  • 137
0
votes
0 answers

How to access ApplicationResource properties in context initialization method?

I am using quartz scheduler which runs after every 15 minutes . So the parameter 15(interval ) i am defining in ApplicationResource.properties file I have listener class defined as public class QuartzSchedulerListener extends ActionSupport…
JMohasin
  • 513
  • 2
  • 13
  • 35
0
votes
2 answers

AndroidHttpClient and Cookies

Using the AndroidHttpClient with cookies gives me intermixed 200 ok and 403 forbidden responses. I'm not sure what I am doing wrong. I'm using the AndroidHttpClient in the following manner: I have several background thread classes, and each one…
benkdev
  • 673
  • 2
  • 16
  • 32
0
votes
1 answer

Trying to get session from a static method, but getting NULL

i am trying to get the current user session from a static function, but the usObj is always null. here is what i'm doing: public static List GetRequestType(string itemNo, int requestTypeID, int claimID) { UserSession usObj =…
Madam Zu Zu
  • 6,437
  • 19
  • 83
  • 129
0
votes
3 answers

the value of "User.Identity.Name" on asp.net mvc 3

i work on web app using asp.net mvc 3 , the problem is with the variable "User.Identity.Name" taht return name and not UserId . have you already this problem ?
ucef
  • 557
  • 3
  • 10
  • 27
0
votes
2 answers

HTTPContext.Current problems - am I using it correctly?

I have a feeling I'm using HttpContext.Current incorrectly, based on some strange code output. I have two pages, http://example.com/Foo.aspx, and http://example.com/Bar.aspx. Both have a button that, when clicked, calls a static function in a class…
Chris
  • 4,030
  • 4
  • 47
  • 76
0
votes
2 answers

ASP.NET HttpContext exclusive values for each user

I am creating a project using ASP.NET MVC 3. So now I need to pass some data that need to be available into the entire project. I am using IHttpModule and set values in the HttpContext items. My doubt is, the values I add into HttpContext items will…
Michel Andrade
  • 4,056
  • 5
  • 27
  • 28
0
votes
2 answers

Error on HTTP Stream PHP

I have this method: protected function _sendRequest($url, $method, Busca_Cxense_Data $data, $get = null) { if (! isset ( $this->_urls [$url] )) { throw new Busca_Cxense_Exception_Argument ( "El tipo de url enviado no es valido. (type:…
Cito
  • 1,659
  • 3
  • 22
  • 49
0
votes
2 answers

How to fetch the current logged in user in Mvc3

Hi i need to fetch the id of the live user and i am able to do it.but the problem arises when i switch from one Port to another it does not fetch the user on another port I have done this: public static Nullable GetLiveUser() { if…
user1274646
  • 921
  • 6
  • 21
  • 46
0
votes
1 answer

I'm using the Unit of Work Pattern in my DAL, but I need to perform data access in Application_Start. What should I do?

Given: When using the Unit Of Work pattern with an ORM in ASP.NET, the UnitOfWork object holds a reference to HttpContext. Question: But what if I need to perform some data access in Application_Start (especially in IIS7)? Is the Unit Of Work…
Jim G.
  • 15,141
  • 22
  • 103
  • 166