Questions tagged [system.web]

System.Web is a namespace of the .NET framework. It supplies classes and interfaces that enable browser-server communication.

System.Web is a namespace of the .NET framework. It supplies classes and interfaces that enable browser-server communication.

References

168 questions
107
votes
3 answers

What is the use for IHttpHandler.IsReusable?

I'm writing a IHttpHandler and I'll need to implement a IsReusable property. When I look at the MSDN documentation it says: Gets a value indicating whether another request can use the IHttpHandler instance. This isn't very helpful. In which…
Kees C. Bakker
  • 32,294
  • 27
  • 115
  • 203
92
votes
3 answers

Using MimeMapping in ASP.NET Core

I'm trying to move my old mvc5 project to asp net core. Old code was: public string ContentType { get { if (!string.IsNullOrEmpty(FileName)) return MimeMapping.GetMimeMapping(FileName); return null; } } Error…
Sauron
  • 2,156
  • 5
  • 17
  • 20
45
votes
5 answers

Cannot add System.Web.dll reference

I'm trying to use the HTTP functions contained in the System.Web.dll assembly. However, whilst the dll seems to exist in the same directory as every other dll Visual Studio 2010 references in my project, it fails to link in and raises a warning -…
JoeR
  • 1,901
  • 3
  • 25
  • 39
41
votes
7 answers

Read Http Request into Byte array

I'm developing a web page that needs to take an HTTP Post Request and read it into a byte array for further processing. I'm kind of stuck on how to do this, and I'm stumped on what is the best way to accomplish. Here is my code so far: public…
Encryption
  • 1,809
  • 9
  • 37
  • 52
29
votes
5 answers

HttpUtility not recognised in .Net 4.5

I Developed a WinForm application in with the target framework set to .net 4.0, now I wish to add to a project that has it's target framework set to .net 4.5. After I added the 4.0 WinForm application to my 4.5 project I keep getting the an error on…
Marnus_Steyn
  • 313
  • 1
  • 4
  • 9
26
votes
3 answers

HttpContext not available in Class Library

I am working on a project where I have a C# class library which needs to use the System.web.HttpContext. I've done this before in another project without problem but now its not working. I'm not sure what I am missing they're both targeting .net 3.5…
Boardy
  • 35,417
  • 104
  • 256
  • 447
19
votes
1 answer

Alternative to HttpUtility.ParseQueryString without System.Web dependency?

I want to be able to build URL query strings by just adding the key and value to some helper class and have it return this as a URL query. I know this can be done, like so: var queryBuilder=…
MartinM
  • 1,736
  • 5
  • 20
  • 33
17
votes
4 answers

Portable Class Library (PCL) Version Of HttpUtility.ParseQueryString

Is there a Portable Class Library (PCL) version Of HttpUtility.ParseQueryString contained in System.Web or some code I could use? I want to read a very complex URL.
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
16
votes
1 answer

System.Web.HttpRequest.FillInFormCollection() and System.Web.HttpRequest.GetEntireRawContent() very slow

I've been following performance of my website and out of all slow-executing code (>1s), more than 90% is because of System.Web.HttpRequest.GetEntireRawContent() (called by System.Web.HttpRequest.FillInFormCollection()) Is this normal for ASP.NET…
nikib3ro
  • 20,366
  • 24
  • 120
  • 181
16
votes
2 answers

How can I do System.Web.Script.Serialization in C#?

How can I do this in C# modern UI ? var url = "http://ajax.googleapis.com/ajax/services/feed/load?q=http%3A%2F%2Fwww.digg.com%2Frss%2Findex.xml&v=1.0"; var wc = new WebClient(); var rawFeedData = wc.DownloadString(url); //You can use…
tovaz
  • 193
  • 1
  • 2
  • 8
15
votes
6 answers

Why can't I find or use UrlEncode in Visual Studio 2010?

I have a string that I'd like to encode into the standard URL format. From what I've found, I should be able to do this via the httpUtility.urlEncode method, but I don't seem to have that available. I've added "using" references to both System.Web…
Sootah
  • 1,771
  • 3
  • 23
  • 42
13
votes
2 answers

system.web functionality in Mono missing?

I need HttpUtility for encoding strings, but it seems it was supported, but no longer. Actually, the whole System.Web is gone. Is there an alternative? I need to Javascript Escape some strings.
12
votes
2 answers

How do I add System.Web as a reference if I cant find it in the list of references?

I'm working on a project in C#.Net 4.0. I am trying to use HttpUtility.HtmlDecode. To do so, I added using System.Web; to the top of the file. However, no reference to HttpUtility could be found. After Googling around a little bit I found that the…
Ken Bellows
  • 6,711
  • 13
  • 50
  • 78
11
votes
4 answers

System.Web assembly is not found on .net 4.0 version

I updated .NET from 3.5 to 4.0 version, but after updating the assembly System.Web doesn't work any more. I'm getting the following error: Warning 1 Could not resolve assembly "System.Web". The assembly is not in the currently targeted framework…
The Mask
  • 17,007
  • 37
  • 111
  • 185
11
votes
2 answers

What is the difference between Convert.ToBase64String(byte[]) and HttpServerUtility.UrlTokenEncode(byte[])?

I'm trying to remove a dependence on System.Web.dll from a Web API project, but have stumbled on a call to HttpServerUtility.UrlTokenEncode(byte[] input) (and its corresponding decode method) that I don't know what to replace with to ensure…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
1
2 3
11 12