473,386 Members | 1,702 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,386 software developers and data experts.

Question about window.open

Hi,

I have a webform that will pop up window by clicking button or links
inside data grid.
Here are some sample code snippet:

'For button
btnOrder.Attributes.Add("onclick", "window.open('order.aspx?.............

'For datagrid
<asp:TemplateColumn>
<ItemTemplate>
<a href="#" onclick="window.open('Modules/AR/order.aspx.........">Order</a>
</ItemTemplate>
</asp:TemplateColumn>

In both instances I use window.open on client side to pop up new window.
The strange thing is, at some occasions I have to use Modules/AR/order.aspx
to open, at other I will have to use the file name order.aspx only without
the path.

The struture in my machine: I have a ASP.Net web application in
http://localhost/Dev. all related aspx files are located in
http://localhost/Dev/Modules/AR directory.

Right now I have to try and err every time to find out if I need to add path
to the filename.

Can somebody suggest a better way to do this? I don't think using absolute
path can resolve my problem either, becase my current application is at
http://localhost/Dev , the application could be moved to
http://someserver/Live or others.
so /dev/Modules/AR/order.aspx is no good for me either.

TIA
Nov 18 '05 #1
1 1217
Hi Danny,

another option would be to add an entry to the Web.Config that
specifies the current path to use. It could look something like this :

<appSettings>
<!-- Test Setting -->
<add key="ActiveAppPath" value="http://localhost/Dev"/>
<!-- Live Setting -->
<!--add key="ActiveAppPath" value="http://localhost/Dev"/-->
<appSettings>

Then grab the path from the config.
Hope this helps.

Tod Birdsall
http://tod1d.blogspot.com

Nov 18 '05 #2

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

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
9
by: Tom | last post by:
I have created the following code for a product select/payment form (don't know if there is a better way) and I have been trying to make the following changes (unsuccessfully so far): 1) ...
3
by: Steve K | last post by:
After reading Harlan's post about popups some of my questions were answered but.. I was going to use differnet popups on a lot of my pages. These popups contain bios on Cornell faculty. Two days...
4
by: Raymond Wilk | last post by:
I used javascript to open a new window, then used the following to close the new window on the next click: <body onBlur="self.close()" onClick="self.close()" bgcolor="#FFFFFF"> On the new window...
12
by: Mal Ice | last post by:
I am creating an initial index.htm page on which I show some disclaimers and introduction information. In the head section I have Javascript which determines the screen resolution of the client....
3
by: datactrl | last post by:
Hi, all When I use window.showModelessDialog() to open a window. And then on the opened window to open an another window with the same function, window.showModelessDialog(). The last opened one...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
1
by: Luis Esteban Valencia | last post by:
I hope this is an easy question, but I'm not sure. I want to open a new window using code behind. I have no problem doing this. I just push javascript and make it open a new window. Now heres the...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
4
by: arajunk | last post by:
In Firefox this opens a full size window (maximized) . In IE it opens the partial window requiring user to click restore (upper right) to maximize. What am I missing ? var...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.