system.web functionality in Mono missing?
Asked Answered
M

2

13

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.

Manichaeism answered 6/5, 2011 at 9:9 Comment(2)
What kind of project are you working on? an asp.net site?Dictatorship
System.Web is not gone in Mono.Metagnathous
B
19

The HttpUtility class lives in the System.Web.Services assembly, just make sure that you are referencing that assembly.

Bronchopneumonia answered 6/5, 2011 at 13:4 Comment(3)
Its a bit confusing that I can just see System.Web.Services in the references, but not System.Web. But adding Services gives me Web too. thanks.Manichaeism
To clarify - HttpUtility is inside System.Web.dll in the desktop/server framework. However, since MonoTouch doesn't include ASP.NET, HttpUtility was moved to System.Web.Services.dll.Evoy
To further clarify, the namespace is still the same although it's in the different .dll, i.e. you still need using System.Web and not using System.Web.Services.Crumpton
H
1

I am using Xamarin Studio with Mono 3.0.10 and in there, you need to reference the System.Web dll and include it with

using System.Web;

Then you will have the HTTPUtility and encode/decode functionality available

Hew answered 23/5, 2013 at 5:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.