473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

HttpUtility.UrlEncode security workaround

I have a need to encode and decode url content. I'm currently using
the UrlDecode and UrlEncode methods from the HttpUtility class.

However the code must be able to run under the .Net Internet
Permission trust level. Since there is a
System.Web.AspNetHostingPermission link demand on the HttpUtility
class, I cannot use the decode and encode methods. Anyone have a
workaround for this?
Nov 18 '05 #1
2 3797
Hi,

You could write your own. Here is a link to a page telling you what you
need to know:

http://www.blooberry.com/indexdot/ht...rlencoding.htm

If you view source you'll see the javascript to do the conversion. If you
translate that into VB.Net or C# you'll be all set. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Marc Cardinal" <mc******@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
I have a need to encode and decode url content. I'm currently using
the UrlDecode and UrlEncode methods from the HttpUtility class.

However the code must be able to run under the .Net Internet
Permission trust level. Since there is a
System.Web.AspNetHostingPermission link demand on the HttpUtility
class, I cannot use the decode and encode methods. Anyone have a
workaround for this?

Nov 18 '05 #2
Have you tried to access it through the server object as Server.UrlDecode()
or HttpContext.Current.Server.UrlDecode()? Sometimes that works better.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Marc Cardinal" <mc******@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
I have a need to encode and decode url content. I'm currently using
the UrlDecode and UrlEncode methods from the HttpUtility class.

However the code must be able to run under the .Net Internet
Permission trust level. Since there is a
System.Web.AspNetHostingPermission link demand on the HttpUtility
class, I cannot use the decode and encode methods. Anyone have a
workaround for this?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kwele | last post by:
I need to use the HttpUtility.UrlEncode method in a winform. However, the HttpUtility class is not available in intellisense from System.Web. What do I need to do to be able to use this method? ...
5
by: bullshark | last post by:
Hi all. Just tearing my hair out here. VSN03 XP all latest. I'm trying to gain use of System.Web.HttpUtility.UrlEncode("string"). The problem is, it isn't there. I've got:
1
by: Muscha | last post by:
Hi, On an ASP.Net I can use UrlEncode() method to encode a URL that I want to forward using respnose.redirect, what's the equivalent of this in Windows Form? I want to be able to do open a...
4
by: Andreas Klemt | last post by:
Hello, is there a difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode ?
2
by: Wayne Wengert | last post by:
I am trying to use the HttpUtility methods shown below in a Windows Form. I cannot get Intellisense to accept the code - I've used Imports System.Web and I also tried adding the specific name space...
1
by: CindyH | last post by:
Hi I'm not sure whether I should send this as a new message or use the one I've been using but... I'm using vb.net 2.0 - My problem is I need to send something like this: 'dim encodedstring =...
0
by: CindyH | last post by:
Hi I'm using .net 2.0. I am receiving a http post that is sent httpUtility.urlencode(doc.Outerxml). Everything works fine and I can receive the post and parse it, but I need to set...
6
by: CindyH | last post by:
Hi I'm not sure whether I should send this as a new message or use the one I've been using but... I'm using vb.net 2.0 - My problem is I need to send something like this: 'dim encodedstring =...
2
by: CindyH | last post by:
Hi I'm using .net 2.0. I am receiving a http post that is sent httpUtility.urlencode(doc.Outerxml). Everything works fine and I can receive the post and parse it, but I need to set...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.