 |
| ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 12th, 2005, 02:21 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Guidelines needed : multiple windows
Hi..
I need to display 9 reports simultaneously on the screen
on the click of a link.
The approach i have applied is : on the click of the link,
open a page "a.aspx" on the load of which i have written
9 window.open statements. My problem is with placement
of windows on the screen. If the client screen is bigger,
the windows should adjust accordingly.
How do i achieve this? Is my approach right?
Can someone suggest me a better approach?
Cheers..
Spacy...
|
|

April 13th, 2005, 09:06 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
You can either use javascript to do this or a 3rd party control such as BrowserHawk to find the dimensions of a client's screen size. Then you can take action according to each size.
J
|
|

April 13th, 2005, 02:55 PM
|
|
Authorized User
|
|
Join Date: Mar 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What are the pixel dimensions of these reports?
Justin Toth
http://www.universityauction.net
|
|

April 17th, 2005, 10:50 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for the prompt reply.
I have tried using javascript, but i get an error "Name 'x' is not declared" when i write this:
Response.Write("<script language=javascript>var x=screen.availheight/3;var y=screen.availwidth/3;")
Response.Write("window.open" & "('page1.aspx','','height=" & x & ",width=300,resizable=yes,scrollbars=yes,status=no ,toolbar=no,menubar=no,location=no,left=10,top=20' );</script>")
The error is in the second response.write statement. Please help
Cheers..
Spacy
|
|

April 18th, 2005, 08:30 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
JavaScript is case sensitive:
availHeight
availWidth
- Peter
|
|

April 18th, 2005, 11:18 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Peter.
I changed the response.write statement to:
Response.Write("<script language=javascript>var x=screen.availHeight/3;var y=screen.availWidth/3;window.open('AAA.aspx','_new','height=' + x + ',width=' + y + ',resizable=yes,scrollbars=yes,status=no,toolbar=n o,menubar=no,location=no,left=10,top=20');</script>")
And it has solved the error
:) Cheers
Spacy
|
|

April 19th, 2005, 08:06 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Ah. Right. I didn't catch this the first time. They don't need to be in one statement if you don't want them to be. But as a result you moved x from the context of .NET to the context of the javascript. This would have worked too:
Response.Write("<script language=javascript>var x=screen.availheight/3;var y=screen.availwidth/3;")
Response.Write("window.open" & "('page1.aspx','','height=' + x + ',width=300,resizable=yes,scrollbars=yes,status=no ,toolbar=no,menubar=no,location=no,left=10,top=20' );</script>")
Also another suggestion: Unless you just need to make a typo correction, it's usually better to add another post to the thread if you solve something before someone else posts instead of editing a post. (Then subscribers get the update in their email too.)
|
|

April 20th, 2005, 12:59 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for the suggestion, Peter.
I will keep that in mind henceforth.
Cheers..
Spacy...
|
|

April 21st, 2005, 06:02 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I think there is a better way of putting in your javascript code in your aspx page. You dont need to do Response.Write for that. That makes things ugly.
in your page you can add a script tag and put your code inside a function.
Code:
<script language="javascript">
function Show()
{
var x = screen.availHeight / 3;
var y = screen.availWidth / 3;
var Att = 'height=' + x + ',width=' + y + ',resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,left=10,top=20'
window.open('AAA.aspx', '_new', Att);
}
</script>
Now from your page you just need to add code to invoke this javascript. (either directly in the HTML or using Attributes.Add)
Regards
Ganesh
|
|
 |