Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 727603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:35:11+00:00 2026-05-14T06:35:11+00:00

I am using silverlight / ASP .NET and C#. What if I want to

  • 0

I am using silverlight / ASP .NET and C#. What if I want to do this from silverlight for instance,

// I have left out the quotes to show you literally what the characters
// are that I want to use
string password = vtakyoj#"5
string encodedPassword = HttpUtility.UrlEncode(encryptedPassword, Encoding.UTF8);
// encoded password now = vtakyoj%23%225

URI uri = new URI("http://www.url.com/page.aspx@password=vtakyoj%23%225");

HttpPage.Window.Navigate(uri);

If I debug and look at the value of uri it shows up as this (we are still inside the silverlight app),

http://www.url.com?password=vtakyoj%23"5

So the %22 has become a quote for some reason.

If I then debug inside the page.aspx code (which of course is ASP .NET) the value of Request[“password”] is actually this,

vtakyoj#"5

Which is the original value. How does that work? I would have thought that I would have to go,

HttpUtility.UrlDecode(Request["password"], Encoding.UTF8)

To get the original value.

Hope this makes sense?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:35:11+00:00Added an answer on May 14, 2026 at 6:35 am

    First lets start with the UTF8 business. Esentially in this case there isn’t any. When a string contains characters with in the standard ASCII character range (as your password does) a UTF8 encoding of that string is identical to a single byte ASCII string.

    You start with this:-

    vtakyoj#”5

    The HttpUtility.UrlEncode somewhat aggressively encodes it to:-

    vtakyoj%23%225

    Its encoded the # and ” however only # has special meaning in a URL. Hence when you view string value of the Uri object in Silverlight you see:-

    vtakyoj%23″5

    Edit (answering supplementary questions)

    How does it know to decode it?

    All data in a url must be properly encoded thats part of its being valid Url. Hence the webserver can rightly assume that all data in the query string has been appropriately encoded.

    What if I had a real string which had %23 in it?

    The correct encoding for “%23” would be “%3723” where %37 is %

    Is that a documented feature of Request[“Password”] that it decodes it?

    Well I dunno, you’d have check the documentation I guess. BTW use Request.QueryString["Password"] the presence of this same indexer directly on Request was for the convenience of porting classic ASP to .NET. It doesn’t make any real difference but its better for clarity since its easier to make the distinction between QueryString values and Form values.

    if I don’t use UFT8 the characters are being filtered out.

    Aare you sure that non-ASCII characters may be present in the password? Can you provide an example you current example does not need encoding with UTF-8?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows azure Webrole application using Silverlight on top of WCF+ASP.NET. I
I am starting to develop a facebook game using ASP.NET + Silverlight Which architecture
I've been given the ask of converting an MVP ASP.NET app to Silverlight. This
First, I have two project working on: ASP.NET and Silverlight Both uses a class
I need to push something into my ASP.NET web form page from a Silverlight
I am currently using this page http://www.silverlightshow.net/items/Silvester-A-Silverlight-Twitter-Widget.aspx to make a Silverlight application that gets
Am using Silverlight 4 hosted in an ASP.NET MVC page, e.g. http://test.example.com/main . I
When you create a Silverlight app using: <asp:Silverlight id=SlApp runat=server Source=~/ClientBin/SLApp.xap MinimumVersion=2.0 /> is
I have just started using silverlight 2 beta and cannot find how to or
I'm using Silverlight Beta 4 for a LOB application. After finding out today that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.