Jump to content

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

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Sanu

Sanu

    Newbie

  • Members
  • Pip
  • 8 posts
hi
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
PReeti

#2
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
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
http://forums.asp.net/t/1435231.aspx

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:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users