How to control the size on an open window

Ido

Freshman
Joined
Oct 12, 2003
Messages
44
Location
Israel
How to set the size of a window

Hi,

I'm writing an ASP.net application.
I have a link (in a datagrid columns) which open a new window upon click.
The URL property of this column is:
"TestResults/NewWindow.aspx?TestID={0}"

I'm not familiar with the syntax.
1. what {0} means?
2. I want to open the "NewWindow.aspx" in small size (not in full screen
size) . How i do that?
3. Also i want to remove the menus,ToolTips, and addressbar from the
"NewWindow.aspx" . How i do that?

Thanks.
 
Last edited:
In the window.open call (in javascript, for example) you can specify flags that determine what the new window looks like. That include flags to make it not resizable, the window size and more.

I can't help much with the ASP datagrid.

-ner
 
1. Inside your aspx file, there should be something like this:

Code:
<asp:HyerLinkColumn Text="Text ID" DataNavigateUrlField="TextID"
DataNavigateUrlFormatString="TestResults/NewWindow.aspx?TestID={0}"
HeaderText="Test ID" />

Please note that I am just making Text and HeaderText up. Anyway, {0} refers to DataNavigateUrlField, which is TextID in this case, hence in the output page, it may display things like:

TestResults/NewWindow.aspx?TestID=1
TestResults/NewWindow.aspx?TestID=2
TestResults/NewWindow.aspx?TestID=3
...

Depending on the TestID of that row.

As for 2 and 3. I believe that Nerseus answered that question. There are plenty of sites with tutorial/code examples on Javascript, just do a search on Google.

Here is one for example (no idea whether is good or not):
http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html
 
launch "window.open" from inside a datagrid cell

Thank you both for the answers!!

Though i have managed to open new window with a javascript,
i want it work from inside a datagrid cell, rather than a self link on
the page, and i don't know how!
(1 column in my datagrid control is a hyperlink column - i would like
to open a new window, with new properties, when user clicked the link
the problem is that i must put somthing in the URL field of the column ,
otherwise i will not be able to click it - so i don't know how to manipulate
it, how to generate my window.open function after click)..

I'm tring now to solve it. It must be a way
Any suggestions?


:o :confused:
 
If anyone interested

Go there:
http://www.datawebcontrols.com/demos/HyperLinkInNewWindowWithJavaScript.aspx


and this is my code:

PHP:
<asp:HyperLinkColumn Text="<img src='../../../Icons/paper.gif' alt='Details..' Border='0'>" DataNavigateUrlField="Ind." DataNavigateUrlFormatString="javascript:var w =window.open('SanitySubTest.aspx?Ind.={0}',null,'width=730,height=310,location=no')" HeaderText="Details"></asp:HyperLinkColumn>
 
Back
Top