Solved

passing backslash as part of querystring

Posted on 2006-11-30
2
792 Views
Last Modified: 2006-11-30
I have a hyperlink as follows
                        <a href="javascript:var w=window.open('Reports.aspx?Path=<%# Eval("rptPath") %>','','width=950,height=400,resizable=yes');" />
                        Show Details...></a>
all it does is opens a pop up page called Reports.aspx while passing a QueryString called Path

where Path holds a physical path of a report example: D:\Reports\xyz.rpt

However.. when i try passsing it as a Query string .. it ignores the blackslash '\' and passes D:Reportsxyz.rpt instead..

Why does this happen.. how can i preserve the blackslash '\' ..

The reason i cannot hardcode it is because the values of Query string named Path is passed dynamically from the database..

Thanks in Advance

0
Comment
Question by:Collindsouza
  • 2
2 Comments
 
LVL 17

Accepted Solution

by:
gops1 earned 500 total points
ID: 18044495
"\" is considered to be an escape character. Why dont you add one more along with that so that they dont get escaped.

Either store in your database or use regular expression.

D:\\Reports\\xyz.rpt
0
 
LVL 17

Expert Comment

by:gops1
ID: 18044501
you can use the other slash too:

 D:/Reports/xyz.rpt
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now