Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

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.

Edited by Ido
  • *Experts*
Posted

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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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

 

<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

Posted

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:

Posted

If anyone interested

 

Go there:

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

 

 

and this is my code:

 

<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>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...