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.

1046 questions
-1
votes
1 answer

Error JobRunShell.cs not found at HttpContextWrapper

I using Quartz .NET to execute code every minute and also refresh Index page after code execution, Quartz working fine to execute code but error while redirect to Index page (UI). Complete code is : Startup.cs public void Configuration(IAppBuilder…
Shri
  • 283
  • 2
  • 13
-1
votes
1 answer

Writing XML file to Users Browser and download

I am writing XML data to the user browser for download. Below is the code protected void WriteXmlToPageDownload(XElement XmlCustomerData) { try { if (XmlCustomerData != null) { …
Troy
  • 11
  • 2
-1
votes
1 answer

httpContext User Identity

I would like to restrict user's access on my website based on the the User Identity and I used following code its works fine in Visual Studio but when I am publishing into IIS sending userIdentity= NULL to Database. Dim httpContext__1 As…
-1
votes
1 answer

Error when accessing resource file in method with parameter key

I'm trying to access my global.resx file from a static method... this is what i have public static string GetElementTextLabel(string attributeName) { string retValue = string.Empty; try { retValue = (string)…
fifamaniac04
  • 2,063
  • 10
  • 45
  • 67
-1
votes
1 answer

how to test form submission in mvc

I'm sending some param via form post from my template and the action in my controller is handling it accordingly. Now I want to write a test case for that action. How should I make that dummy request so that Request.Form["selectedSuppliersHidden"]…
-1
votes
1 answer

session in class file

Hi I have a list called Event Source. In that am adding new item. Once i added , the background process takes this newly created id and start importing EventFields in the Specific List.In EventSource list item i have an ECB menu item called Sync and…
user2518802
  • 21
  • 1
  • 7
-1
votes
2 answers

Getting the user's local IP - Always getting 192.168.2.1

I need to get the user's local IP for my ASP.NET application and I'm using this method: protected string GetIPAddress() { System.Web.HttpContext context = System.Web.HttpContext.Current; string ipAddress =…
user1761123
-1
votes
2 answers

HttpContext.Current NullReferenceException in asp.net MVC

I have 2 RAZOR Index forms in my application. 1 Form creates records in one database "LocalDB" and updates the same record in another database "Core DB". Another Form sync records from "CoreDB" to "LocalDB". Have to do this because there are other…
Vivek Patel
  • 343
  • 2
  • 4
  • 20
-2
votes
2 answers

Null in context.Request

How to allow null in Context.Request: context.Response.Write(retrieveList(context.Request["SalCode"].ToString(null), context.Request["groupKeyword"].ToString(), context.Request["text"].ToString()));
ChristineS
  • 433
  • 1
  • 6
  • 12
-3
votes
1 answer

Accessing http headers in .NET Core 3.0 Api

Inject IHttpContextAccessor through constructor. private readonly IHttpContextAccessor _httpContextAccessor; public Handler(IHttpContextAccessor httpContextAccessor) { _userManager = userManager; …
Dev-lop-er
  • 119
  • 1
  • 10
-3
votes
2 answers

How to properly extract content from object converted to string c#?

I am writing Unit-Tests and am trying to extract a value from a HttpResponseMessage. I am trying to get the value resultCount. Currenly my string looks like this:"{"resultCount":5,"works":null,"success::false,"errors"null}" Any ideas how I can get…
jward01
  • 663
  • 4
  • 9
  • 23
1 2 3
69
70