Ido Posted June 8, 2004 Posted June 8, 2004 (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 June 8, 2004 by Ido Quote
*Experts* Nerseus Posted June 8, 2004 *Experts* Posted June 8, 2004 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 Quote "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
bob01900 Posted June 8, 2004 Posted June 8, 2004 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 Quote
Ido Posted June 9, 2004 Author Posted June 9, 2004 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: Quote
Ido Posted June 9, 2004 Author Posted June 9, 2004 Hi, i've found a solution! I found this link: http://www.dotnet247.com/247reference/msgs/27/137995.aspx My problem now is how to send a parameter to the new created windows. ..or how to send a dynamically change parameter to the new window - (not just window.open("new.aspx?key=1"))\\ Anyway i open new thread about that. Thanks again. Quote
Ido Posted June 9, 2004 Author Posted June 9, 2004 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> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.