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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Public Sub InfoClick(ByVal sender As Object, ByVal e As CommandEventArgs)

Dim pRank As String = e.CommandArgument

Response.Write("<script>window.open('siteinfo.aspx?siterank='" & pRank & "','Info','left=20,top=20,height=500,width=850,toolbar=no,status=no,resizable=1,scrollbars=no')</script>")

End Sub

0
jackcustard
1/5/2006 7:20:41 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
1468 Views

Similar Articles

[PageSpeed] 14

This doesn't work because you're doing this work on the server and simply rendering out some arbitrary text to the client. 

Instead, what you should do is write the javascript into a function inside a script block in your page / masterpage.  Then call that function from the OnClientClick property of the LinkButton. 

--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
0
dannychen
1/5/2006 9:17:33 PM
Reply:

Similar Artilces:

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

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

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

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------------------ Hi keeara, Use window.resizeTo(iWidth, iHeight). Cheers, Peter BrunoneMS MVP, ASP.NETFounder, EasyListBox.comDo the impossible, and go home early. but can i access it by server side code? i am using vb.n...

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

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

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

How to open a new web form in a new window?
How to open a new web form in a new window when we click on a button? Ex: I Have a Webform1.aspx which has a button and a few other controls. When click on the button i need to open a small window with Webform2.aspx which has a few other controls, the user enters the data and clicks on ok when we need to save and close webform2 and go back to webform1.aspx. How to do this? Any suggestions will be appreciated. Thanks. Check out these articles: http://www.codeproject.com/aspnet/Modal_Dialog.asp http://www.c-sharpcorner.com/Code/2003/Sept/ModalPopupInASP.NET.asp Darrell Norton, M...

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

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

Open Web Form Using Server.Transfer in New Explorer Window
Hi, I have a requirement to open the form as MODAL using Server.Transfer. It should be opened in New Explorer Windows Any Idea? Regards Atif     hi, I think you had better use javascript window.showModalDialog, cause Server.Transfer cannot open a new window. Hi, Thanks for prompt response. I know how to open the MODAL FORM using Javascript.  If I want to pass let say one variable to Child Form. How do i do this ? ... this variable is transaction id and shouldn't be part of the HTTP Query (Confidential). How can do this ?     ...

Web resources about - OPEN NEW WINDOW USING window.open - asp.net.web-forms

Window - Wikipedia, the free encyclopedia
This article is about the part of a building. For the Microsoft operating system, see Microsoft Windows . For other uses, see Window (disambiguation) ...

Microsoft Windows Information, Solutions, Tools - Windows IT Pro
Microsoft Windows information and solutions for IT pros. Topics include cloud computing, Windows Server, Exchange, Outlook, PowerShell, virtualization, ...

The Windows Blog
The Windows Blog is Microsoft's Official Blog for the Windows Operating System.

High Court move to extend enrolment window and unlock one million votes
Laws that prevent Australians from enrolling to vote in the weeks leading up to a federal election are set to be challenged in the High Court. ...

Cammeray death: Man dies after allegedly being ‘pushed’ from window - DailyTelegraph Search Search
POLICE have launched a murder investigation into the death of a 44-year-old man who fell to his death from a eighth-floor unit in Sydney’s north ...

Cammeray death: Man dies after allegedly being ‘pushed’ from window
POLICE have launched a murder investigation into the death of a 44-year-old man who fell to his death from a eighth-floor unit in Sydney’s north ...

Lenovo fixes two security vulnerabilities in its preloaded Windows tools
Lenovo has issued a patch which fixes vulnerabilities located in the software which comes preloaded with some of the laptops it sells. The company ...

Street View gives you a window into climate change
... our changing climate, we want to take this opportunity to show you how to explore its impact yourself. With Street View, you can get a window ...

EXCLUSIVE: Calais Trucker’s Close Brush With Death as Migrants Hurl WOODEN STAKE Through Cab Window
A Czech driver passing through Calais has narrowly avoided being killed by immigrants when they hurled a long wooden stake through the window ...

Woman, 80, breaks window to try to free husband from fire
Texas woman focused on saving husband after escaping from house on fire

Resources last updated: 11/30/2015 8:15:27 AM