Groups | Blog | Home
all groups > asp.net > april 2005 >

asp.net : Window Open Server Side



jack-b NO[at]SPAM humlog.com
4/17/2005 10:58:25 PM
Hi,

How do I open a new window in a button click event (server-side)?

I need to open it from this event because once the user has click the
button, the event handler does some processing and creates a query
string.

If I didn't need the query string it wouldn't be a problem - I would
just use javascript client-side.

e.g.

Private Sub PreviewButton_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles PreviewButton.Click

-process data

-create query string

-open new page with query string

End Sub

I have tried adding this:
PreviewButton.Attributes.Add("onclick",
"window.open('somedoc.html','somename',
'width=150,height=150,resizable=1)")

and this:

Response.Write("<script
language=javascript>window.open('somedoc.html',' new')</script>")

without luck!

Thanks,
Steve C. Orr [MVP, MCSD]
4/17/2005 11:26:26 PM
This article shows how to use javascript in your pages, including
window.open.
http://SteveOrr.net/articles/clientsidesuite.aspx

Here's more info:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp

Some popup blockers may foil your plans however, so consider alternate
designs.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


[quoted text, click to view]

AddThis Social Bookmark Button