By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,678 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,678 IT Pros & Developers. It's quick & easy.

Window Open Server Side

P: n/a
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,
Jack
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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/a...ods/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
"Jack" <ja****@humlog.com> wrote in message
news:6e**************************@posting.google.c om...
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,
Jack

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.