Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

Syntax for path

I'm trying to open a page in a new window. The page that I am trying to open is in a different folder than the page I am currently on.
The page I am on is in folder www.mywebsite/administrator/reports
The page I am trying to open is in folder  www.mywebsite/orders/crystal reports

Here is the command I am using
ScriptManager.RegisterClientScriptBlock(Me.UpdatePanel1, Me.UpdatePanel1.GetType(), "AnyScriptNameYouLike", "window.open('./orders/crystal reports/Print Order Cust.aspx');", True)

The problem is it tries to find the path in folder www.mywebsite/administrator/reports/
orders/crystal reports


What is the syntax to open the page in folder www.mywebsite/orders/crystal reports
0
whiwex
Asked:
whiwex
  • 3
  • 2
1 Solution
 
käµfm³d 👽Commented:
Try using "%20" for the space:

e.g.

www.mywebsite/orders/crystal%20reports

Open in new window

0
 
Gerry BartleySoftware EngineerCommented:
Tilda or .. should work

ScriptManager.RegisterClientScriptBlock(Me.UpdatePanel1, Me.UpdatePanel1.GetType(), "AnyScriptNameYouLike", "window.open('~/orders/crystal reports/Print Order Cust.aspx');", True)
0
 
whiwexAuthor Commented:
I tried "window.open('//orders/crystal reports/Print Order Cust.aspx');", True)
but it searches in http://orders/crystal%20reports/Print%20Order%20Cust.aspx

I tried "window.open('~/orders/crystal reports/Print Order Cust.aspx');", True)

byt it searches in wwwmywebsite/administrator/reports/~/orders/crystal%20reports/Print%20Order%20Cust.aspx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
whiwexAuthor Commented:
I tried "window.open('../orders/crystal reports/Print Order Cust.aspx');", True)

but it searches in I tried wwwmywebsite/administrator/orders/crystal%20reports/Print%20Order%20Cust.aspx
0
 
Gerry BartleySoftware EngineerCommented:
Oops I'm such a plank.
 tilde. ~ won't work with JavaScript

Try this
dim uri as string= Page.Request.Url.GetLeftPart(UriPartial.Authority) & "/orders/crystal reports/Print Order Cust.aspx"
dim jscript as string= string.Format("window.open('{0}');",uri)

ScriptManager.RegisterClientScriptBlock(Me.UpdatePanel1, Me.UpdatePanel1.GetType(), "AnyScriptNameYouLike", jscript, True)
0
 
whiwexAuthor Commented:
Thanks I ended up using HttpContext.Current.Request.ApplicationPath
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now