solution for Space is shown as %2520 insted of %20 in link url

HI Friends

Today i would like to discuss one of the issues which took 3 days of my time in searching around google so today i am presenting both problem and solution

the problem is
my dotnet code was generaing dynamic html in code behind and among them there exist a link with url pointing to some file example

a href=”//fileserver/foldername/abc 10.pdf”

so here my browser was intended to show like this when a cursor is placed on link

a href=”//fileserver/foldername/abc%2010.pdf”

here as you all know browser shows space as %20

but my browser was showing %2520 insted of %20 which was causing the issue

the link was like this when issue exist
a href=”//fileserver/foldername/abc%252010.pdf”
where as browser was expecting
a href=”//fileserver/foldername/abc%2010.pdf”

so was searching about the issue came to know several people answers like placing Runat= server in link is the solution or problem with file server or problem with browser
hmmm ultimately one fine day i got the solution 🙂 the solution is
just append <b>”file:///”</b> before the path this will solve your problem

so as solution i placed like this

a href=”file:///fileserver/foldername/abc 10.pdf” in code behind and browser was now showing correctly as

href=”//fileserver/foldername/abc%2010.pdf”
Just posting it as you people should not waste your time searching for this as one of the guy on earth found it and ready to share this to avoid time waste

cheers
Santosh Kakani

 

Advertisements

About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Coding and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s