473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how to set relative url for window.open and hyperlink

Hi !

I have a problem with defining a relative url, which is one of
parameters of window.open call.
Here is the situation:

1. "Parent" page called 2000 is in subfolder of my app, the subfolder
is called Z.
2. On the 2000 page there is an asp hyperlink, which should open new
window with 2010 page. But since the window can't have browser menu
etc. I set onclick attribute with window.open command instead of
NavigateUrl property.
3. The 2010 page is also located in Z subfolder.
4. As an url of hyperlink I set /Z/2010.aspx
I tried also ~/Z/2010/aspx but it never worked.
5. Everything works fine when my app is run against Visual Studio
build in server. I mean the 2010 page opens in new browser window when
hyperlink is clicked, opens under url
http://localhost:2554/Z/2010.aspx page

6. The above doesn't work when app is deployed on IIS. Browser
attempts to open
http://localhost/Z/2010.aspx page
while it should be
http://localhost/MyApp/Z/2010.aspx.

What is wrong ?
Jun 27 '08 #1
1 7183
I found solution for that: the url which is passed to window.open must
be full url.
To get "prefix" I call
this.ResolveClientUrl("~/Z/2010.aspx")
and tylda character (~) is replaced automatically as needed.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
4
by: Olav Tollefsen | last post by:
I have an <asp:Hyperlink> in my .aspx file. How can I configure it to open the URL (NavigateURL) in a popup window instead of a new normal browser window. I use Target="_blank", but didn't find...
4
by: KenG | last post by:
Hi: I have a datagrid that builds a hyperling which uses javascript to open a new window. The new window opens and displays fine, however, the original window that has the grid, is now blank...
6
by: G Dean Blake | last post by:
in my aspx app I am writing a stream that works fine but it replaces what is in the client browser window. The code is as follows: .. .. HttpContext.Current.Response.ClearHeaders()...
9
by: dana lees | last post by:
Hello, I am using asp:HyperLink in a c# asp.net application to open a new window in the following way: <asp:HyperLink ID="lnkSiteName" runat="server" Text='<%# DataBinder.Eval(Container,...
9
by: loga123 | last post by:
I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE...
9
by: smokeyd | last post by:
hi, can anyone tell me how to open a link in a new browser window in vbscript.net. i am looking to be able to set the properties such as size, menu bar, scroll bar etc. or alternativelly is...
1
by: Mike P | last post by:
I am adding a hyperlink to a table and I want the hyperlink to open a window with height and width I can set myself when it is clicked : HyperLink hypGetExtractSQL = new HyperLink(); ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.