Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

how to pass special character in a querystring in asp.net

asp.net string

  • Please log in to reply
1 reply to this topic

#1 Sanu


    CC Lurker

  • Just Joined
  • Pip
  • 8 posts

Posted 27 April 2010 - 02:01 AM

Tell me how to pass special character in querystring. i want to pass '#' and '++'
my code is this

<li><a href="TechQuiz.aspx?i=C#2">C# 2</a></li>
<li><a href="TechQuiz.aspx?i=C++1">C++ 1</a></li>

its only pass 'C 2' in TechQuiz page.Plz Tell me how to solve this problem

WIth REgds
  • 0

#2 gokuajmes


    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 483 posts

Posted 27 April 2010 - 03:47 AM

preeti , the characters are encoded for your own good so better not mess with that, as a Answer for your question read the following post

You have to use the Server.URLencode to encode the characters & then request the query string .The browser will automatically detect any special characters & decode them to symbols.
[special characters are not allowed in interest of Security Measures,Also script injection attacks]

Feed me more +Reps:thumbup1:
  • 0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download