|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Open New Window Server SideHow 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 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. Show quoteHide quote "Jack" <jac***@humlog.com> wrote in message news:6ea814a3.0504172159.6e3913a@posting.google.com... > 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
Uncheck Checkboxes
Repeat web controls in ASPX page How to validate one of two Required TextBox TemplateControl?? how to display records in datagrid Dynamic loadcontrol of ascx with dll not in bin path GridView Rows collection refresh within an event Textboxes with images AddHandler / Remove Handler? DBNull.Value and the dropdownlist |
|||||||||||||||||||||||