automatically adjusting the new window size opened using window.open()

i am using window.open() javascript method specifying the height and width of the new window. but the problem is the contents are bit bigger than that, they will be invisible and if they are less, there will be blank white screen which doesn't look very good. so is it possible to adjust the size of new window automatically depending upon the content?
-keeara g
------------------
0
keeara
11/11/2004 1:20:20 AM
asp.net.client-side 24353 articles. 1 followers. Follow

3 Replies
1154 Views

Similar Articles

[PageSpeed] 20

Hi keeara,

Use window.resizeTo(iWidth, iHeight).
Cheers,

Peter Brunone
MS MVP, ASP.NET
Founder, EasyListBox.com
Do the impossible, and go home early.
0
peterbrunone
11/11/2004 5:25:40 AM
but can i access it by server side code? i am using vb.net. actually i want to resize the window based on the size of datagrid within the window.
-keeara g
------------------
0
keeara
11/11/2004 5:43:29 AM

No, you can't access it with server-side code. You'll have to figure out your datagrid height, and then output some javascript with the correct numbers. Use RegisterStartupScript or just put the tiny little script in a label.
What I often do is just have a small script with a label inside it for the value, like this:

<script language="javascript">
window.resizeTo(<asp:Literal id="litWidth" runat="server" />, <asp:Literal id="litHeight" runat="server" />);
</script>

Then you just set the literals' Text property to the proper numbers, and you're done.
Cheers,

Peter Brunone
MS MVP, ASP.NET
Founder, EasyListBox.com
Do the impossible, and go home early.
0
peterbrunone
11/11/2004 6:12:33 AM
Reply:

Similar Artilces:

OPEN NEW WINDOW USING window.open
Hi, can any eagle eyed geniuses spot what I'm doing wrong here? It's doing my nut! I'm simply trying to call a new page in a new window that I want to control the size, etc. I've tried two different ways - one from within my code behind and the other triggered by a LinkButton command action. Both do absolutely nothing. Please help... Private Sub InfoClick1(ByVal pSiteCode) Response.Write("<script>window.open('siteinfo.aspx?sitecode='" & pSiteCode & "','Info','left=20,top=20,height=500,width=850,toolbar=no,status=no,resizable=1,scrollbars=no')</script>") End Sub +...

opening new window other than window.open
is there any other way of opening a new window... aside from window.open? window.open has a memory leak so i want to prevent using it as much as possible.Alvin ShihSoftware DeveloperMCP MCTS MCPD Hi window.showmodaldialog() but supports only IE....   Regards Suresh Kumar Goudampally Why dont you avoid pop up windows all together and use an iframe that is positioned over the content? Eric Pascarello.com | Twitter epascarello | LinkedIn Hi,Try Target="_blank" N.P.SenthilSoftware Engineer  Link buttons targer property is set to "_blank"...

Open a new window with window.open()
Hi, =20 in our web application, we try to open a popup-window with window.open(). But instead of opening a new window, a new tab is opened. =20 In the SeaMonkey preferences, we configured it, to open new links in a new tab. With firefox, we had the same preferences, but when window.open() was called, a new window was opened.=20 How can we configure SeaMonkey, so that it has the Firefox behavior when calling window.open() ? =20 Thanks in advance. =20 =20 =20 Artur Zeiler schrieb: > Hi, > > in our web application, we try to open a popup-window wi...

How to open url in new window and use previous window when already opened
We can achieve this by using a simple javascript function....     var WindowObjectReference; function openRequestedSingleWindow(strUrl, strWindowName) {     if(WindowObjectReference == null || WindowObjectReference.closed)    {      WindowObjectReference = window.open(strUrl, strWindowName);    }    else    {      WindowObjectReference.focus();    } } Here we use a WindowObjectReference as a global variable to track the opened window. If opened for the fir...

how can I use window.opener but with window.showModalDialog instead of window.open
Hi, I tried the code bellow that I found in  :  4guysfromrolla site:the code displays a source page, whn I click on the Calendar <a href />  link  i get a calendar displayed on a target page. when I select a date, the calendar page closes and populates the textbox txtDate with the chosen date. Here is the code of the 2 pages and my question is down bellow:a source page called frmCalendar.aspx has this:<form name="frmCalendar">   <input name="txtDate" type="text" />   <a href=&q...

window.open() opens new window
Firefox 19.0 Windows XP Pro SP-3 Example site URL: http://www.pcconnection.com/ (I've hit this problem at many sites, however.) Firefox is configured (enabled) as: Tools -> Options -> Tabs "Open new windows in a new tab instead" = Enabled Presumably this means when a page tries to open a new window (another instance of the web browser) that instead a new tab will appear in the current window. Works that way in IE8 (when "Always open popups in a new tab" is enabled). Go down the page and click on the "Site Help" link. What I get...

Problem with opening new window "window.Open" using javascript
I am trying to open new window when press a button "btnPrint" using: Response.Write("<script language='javascript'> window.open('CouponReport.aspx', 'window', 'HEIGHT=600,WIDTH=820,top=50,left=50,toolbar=yes,scrollbars=yes,resizable=yes'); </script>"); but when the new window opened the current page do a post back action and the current page format change like the following: before window open: after window opened: So, how i can a void the post back action.  <script language='javascript'> funct...

PDFS open in new window, used to open in FF window with URL showing
I don't recall changing anything except maybe the application Firefox is supposed to use for PDFs, from Adobe to Foxit Reader. If When I opened PDF files from the address bar I used to still have the address bar showing. This was handy for calling up IRS forms, then changing the "f" in the address bar to "i" to call up the instructions. Now, at least with Foxit Reader, it opens in a separate window without showing the actual URL downloaded in the Firefox address bar. It used to open in the same window as I recall, showing the address of the downloaded file. ...

superreview granted: [Bug 429926] Make Cmd+T open a new window when no browser windows are open : [Attachment 316692] BrowserOpenTab() even when no windows are open
neil@parkwaycc.co.uk <neil@httl.net> has granted Stefan <stefanh@inbox.com>'s request for superreview: Bug 429926: Make Cmd+T open a new window when no browser windows are open https://bugzilla.mozilla.org/show_bug.cgi?id=429926 Attachment 316692: BrowserOpenTab() even when no windows are open https://bugzilla.mozilla.org/attachment.cgi?id=316692&action=edit ...

superreview requested: [Bug 429926] Make Cmd+T open a new window when no browser windows are open : [Attachment 316692] BrowserOpenTab() even when no windows are open
Stefan <stefanh@bluebottle.com> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 429926: Make Cmd+T open a new window when no browser windows are open https://bugzilla.mozilla.org/show_bug.cgi?id=429926 Attachment 316692: BrowserOpenTab() even when no windows are open https://bugzilla.mozilla.org/attachment.cgi?id=316692&action=edit ...

superreview cancelled: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225294] close blank window
Marria Nazif <marria@gmail.com> has cancelled Marria Nazif <marria@gmail.com>'s request for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225294: close blank window https://bugzilla.mozilla.org/attachment.cgi?id=225294&action=edit ...

superreview requested: [Bug 241972] new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins : [Attachment 225294] close blank window
Marria Nazif <marria@gmail.com> has asked Darin Fisher (Google) <darin@meer.net> for superreview: Bug 241972: new window opened by window.open('xxx.exe') or target="_blank" isn't closed automatically when a download begins https://bugzilla.mozilla.org/show_bug.cgi?id=241972 Attachment 225294: close blank window https://bugzilla.mozilla.org/attachment.cgi?id=225294&action=edit ------- Additional Comments from Marria Nazif <marria@gmail.com> This is a first try at closing the window after the external app handler has done its work. This se...

window.open and window.opener
Sorry for a really dumb post. I am not a scripting person... I find the whole thing a bit strange really with losely coupled types ect...Anyway, I am putting together a ASP.NET v2 application. One of the pages I am planning on implementing a link to open a pop-up window. In this popup window, the user will select the location of somthing, the window close and the value returned back to one of the parent browsers controls. I know this is not rocket science and I have done endless searches to try and find the answer. I am loading up the page and passing in the ClientID of the control I wish to...

Opening a new window in a new window using java script
I have an application where I need to open a new window and in that opened new window a button will be there clicking on which I have to open the other new window. I did in the normal way i.e, window.open('../NWINNW/FirstWindow.aspx','mywindow','width=730px,Height=290px,left=100px,top=100px,scrollbars=yes'); in the default page and window.open('../NWINNW/SecondWindow.aspx','mywindow','width=730px,Height=290px,left=100px,top=100px,scrollbars=yes'); in the first window page. The first opens correct but the second window is opening in the sa...

Web resources about - automatically adjusting the new window size opened using window.open() - asp.net.client-side

Piccolo Automatically Sends Users Prints Of Their Photos On Facebook, Instagram
... a popular day for debuting Instagram applications and services, as startup Piccolo announced its beta launch, aimed at allowing users to automatically ...

Facebook Status Update Tagging Now Automatically Suggests Matches for People, Pages and Other Content ...
Facebook has just changed its status update tagging tool to automatically display a drop-down menu of friends, Pages, events and groups you might ...

Meekan - schedule meetings and events automatically on the App Store on iTunes
Get Meekan - schedule meetings and events automatically on the App Store. See screenshots and ratings, and read customer reviews.

Does Google see automatically generated content as a bad thing? - YouTube
Does Google see automatically generated content as a bad thing (i.e. spam)? If I publish uncopyrighted content on my site that is available from ...

Emailing porn at work not automatically sackable, court finds
The federal court has upheld a ruling that found emailing pornography in the workplace is not automatically a sackable offence.


Emailing porn at work not automatically sackable, court finds
Australia's federal court has upheld a ruling that emailing pornography in the workplace is not automatically a sackable offence.

Shazam iPhone app now listens for music, TV shows automatically
Shazam has updated its iPhone app to tag songs, TV shows and more on its own, no longer requiring users to open the app and tap a button.

App of the day: Human for iPhone automatically tracks your movements
Human for the iPhone is an activity tracker that automatically distinguishes between different types of movement.

iPhone 5 automatically rotates using Cycloramic App. - YouTube
[NEW VIDEO] Cycloramic 2.0 update teaser vid with panoramic photo preview: http://www.youtube.com/watch?v=cjHUID07xs4 Cycloramic has been Awarded ...

Resources last updated: 12/20/2015 10:01:41 AM