473,400 Members | 2,163 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,400 software developers and data experts.

Open WebForm to size from code behind

mg

window.open (URLTarget, windowName,
height=720,width=975,resizable=yes, ...

lets me open a new WebForm with a specified size using
JavaScript.

Is there a way of doing this from code behind; something
like

if (rbX.Checked == true)
{
Server.Transfer("Page2.aspx" ...
}

where I can use logic involving WebForm components.

(Or, using the page properties in Visual Studio .NET)

Nov 18 '05 #1
2 2273
You can't spawn a new browser window or resize the user's browser on the
client side using server side script - you're going to have to emit client
side script to do this.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"mg" <mg@theworld.com> wrote in message
news:10****************************@phx.gbl...

window.open (URLTarget, windowName,
height=720,width=975,resizable=yes, ...

lets me open a new WebForm with a specified size using
JavaScript.

Is there a way of doing this from code behind; something
like

if (rbX.Checked == true)
{
Server.Transfer("Page2.aspx" ...
}

where I can use logic involving WebForm components.

(Or, using the page properties in Visual Studio .NET)

Nov 18 '05 #2
There aren't any server side code that will help you
control the size of a client side browser window. Atleast
not that I'm familiar with.

But you can force feed client side javascript code thru
you server side code.

Try the following.

On Page load event of your page(page/window that you want
to resize) before postback put this in,

Page.RegisterStartupScript("", <script
language=javascript>window.resizeTo(300, 200);</script>);

HTH,
Suresh.
-----Original Message-----

window.open (URLTarget, windowName,
height=720,width=975,resizable=yes, ...

lets me open a new WebForm with a specified size using
JavaScript.

Is there a way of doing this from code behind; something
like

if (rbX.Checked == true)
{
Server.Transfer("Page2.aspx" ...
}

where I can use logic involving WebForm components.

(Or, using the page properties in Visual Studio .NET)

.

Nov 18 '05 #3

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

Similar topics

2
by: Cathy | last post by:
Has anyone ever made a webform button run an onClick event that is a Javascript in the HTML code and then after running the script make it go into the code-behind? An HTML button will run the...
2
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
2
by: adiel | last post by:
Hello, I am trying to access the properties and methods from a user control within the code-behind file for a webform but I am receiving the message: Name 'MenuBar1' is not declared It does...
2
by: John A Grandy | last post by:
for the code-behind a WebForm, it's easy to use ASP.NET session state -- just refer to the built-in Session object ... but how to write code elsewhere that utilizes this same object ? within a...
1
by: timmso | last post by:
If I create a webform in notepad (save it with an .aspx extension), I can see the VB.Net code along with the ASP.Net code in one file. If I create an Asp.Net web application and add a web form...
3
by: Tim Zych | last post by:
If I declare a procedure in a webform as Public and attach it to a button in the same webform, it runs fine. If I change it to Private Sub and try to click it i get the error: ...
2
by: Craig Douthitt via DotNetMonster.com | last post by:
I am trying to capture an buttonclick on a usercontrol in the webform the usercontrol resides in. After researching this issue, I've come to believe that the best way of handling this is by raising...
12
by: Raed Sawalha | last post by:
I have the following table which i can not switcha to design view error message said Could not open in Design view. Quote values differently inside a '<% ...."value"... %>' block. and the...
8
by: vinesh | last post by:
I have sample Asp.Net Web Application project. Let me know how to keep the files related to this project (like the webform.aspx, WebForm1.aspx.vb, WebForm1.aspx.resx) in a separate folder within a...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.