.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Open a new Window on Button_click event

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :ASP.Net

Hello, I am learning Visual Studio 2008 on the fly.

I'd like to get a help on how to open a new window when the report is opened for view.


1. Populate the asp:DropDownList to fill PDF file names

2. Select the report and click asp:Button

3. Pop a new window to browse the PDF file.

1 and 2 are working fine but for #3 - the report shows up but I can't goback to Home page unless i kill the window and restart the App or use the back button on IE.

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim org = "C:\Documents and Settings\My Documents\PDF\"


View Complete Post

More Related Resource Links

Unexpected window.open Event


I have a small amount of experience with ASP.Net and I have inherited a project that has gone through many hands. I'm not sure if anyone can help me on this, but here goes. 

I have an .aspx page (Home.aspx) with an image button (ibEdit) and a link button (btnEditExpiration). The image button was created by another developer before I inherited the project. It is designed to reveal a hidden part of the page, with fields to edit customer information. I have added the link button to open another form  (EditExpirationDates.aspx), populated with information from Home.aspx 

When I click on ibEdit, everything works as expected. When I click on btnEditExpiration everything works as expected. The problem arises after I click on the btnEditExpiration button. Thereafter, every time I click on ibEdit , it's as if both click events fire and the EditExpirationDates.aspx form opens .

If I close the page and reopen it everything works fine until I click the btnEditExpiration.

Any suggestions would be appreciated.

Code shown below:


Button event lost after window.open



I have a form with a field which could be populated manually (by typing in it) or through a window.open popup window. The user just have to select the value in the window and it's written in the field of the parent window (all in javascript). 

When I enter the value manually, all is fine. However, when I do it through the popup window the value is correctly written in the parent window and the popup is closed, but the click event of the submit button is not raised when i submit the form. The Page Load event is raised and the IsPostBack is set to false.

What could be the problem?


How to get Button_Click open in new window


I want to redirect to a page on a different website in a new window.  The Button2_Click routine below works fine but overwrites my active window. 

protected void Button2_Click(object sender, EventArgs e)
        Response.Redirect("http://" + TextBox10.Text);

Tried a straight HyperLink, it displays but it does absolutely nothing - nothing happens when clicked - no response and when you hover over the link with the mouse the target URL does not appear in the browser status window.

<asp:Hyperlink ID="LinkStats" runat="server" NavigateUrl='<%= "http://" + TextBox10.Text %>' Target="_blank" Text="LINK STATS" >Link Stats</asp:HyperLink>

Any thoughts? 

Thank you.


Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

Open a link in new window from a custom fields description MOSS 2007



I have kept a help link (ex: http://www.msdn.com) under a document library field's description. i want this link to be opened in a new window with out navigating from that page.

any ideas greatly appreciated.




Open aspx page in new window or tab



    I use the following code in a Buttons onClick handler.



Is it possible to open the EIQuotationReport.aspx web form in a new window or a new tab? I could change the button to a hyperlink if required.



Binding an event method from a control in a seperate window

How would you bind a event method from a control back to a seperate window?  I have a ActiveX control hosted in a WindowsFormsIntegration wrapper.  That is operating in its own window along with all its events.  The properties of the control are handled by a class that defines the dependency objects (thanks Bob) to provide a view model between it and a window with controls for setting/getting those properties.  Since events constrained to Window 2, is it possible to bind the events back to Window 1?

Open my aspx page in new window....

Hi..On button click im using this Server.Transfer("abc.aspx", true); to transfer to abc page.. what i need is i need to open in new window by this abc.aspx page on button click..here im passing parameter to abc.aspx page, so let me know how to do...so plz let me know how to achieve this....

>>> Open a Popup window on Successful Login if something new added to website.

Hi, I would like to open a Popup window in Parallel if user Login successfully. The popup will give updates to the user that what's new added to the website. The popup will open only once if user login. If he logout and will re-login then it should not popup as we'll assume that he has been notified earlier. I have users table with user id's. It is for information that I am working in Framework 2.0 and not allowed to use any third party or AjaxToolkit. Therefore javascript or any other technique will resolve the issue. Any idea with coding example would be helpful.

Window.Open in AJAX Accordian Panel Opens Link in Same Window

I'm using the following span to open a page in a new window. What is INCREDIBLY odd is that it is exactly the same code from three different pages, but the first refuses to open in a new window. The only difference is that the first example resides within an Ajax Accordian Panel so I suspect that it might be an Ajax related issue. Ideas? Does not open in new window.<span onclick="window.open ('http://[domainname]/Mercury/production/content/directory/DirectorySideBar.aspx','mywindow','width=271,height=498,scrollbars=no');">   Opens in new window<span onclick="window.open ('http://[domainname]/Mercury/production/content/directory/DirectorySideBar.aspx','mywindow','width=271,height=498,scrollbars=no');">   Opens in new window<span onclick="window.open ('http://[domainname]/Mercury/production/content/directory/DirectorySideBar.aspx','mywindow','width=271,height=498,scrollbars=no');">  

how to open 2 different windows from different buttons with window.open or...

Hello, I'm trying to open 2 different windows from different buttons with window.open Do not manage... Annyone  who knows how? I need code xample...   Is it posible to set ID for this window.open ?   Thanks

Links to open new browser window?

I've setup some links on "My Site" and can't seem to figure out how to get them to open the links in a new window. I'd also like to do this for my RSS feed links.(This is in MOSS 2007) Can someone help?

Open a new window in existing window using WPF

Hi All, I'm trying to create a form which may be used as an MDI form. As far as I came to know with that there is no support for MDI form in WPF so is there any other way to fulfill this requirement. All help is welcome.   Thanks in anticipation. 

GridView Select Open New Internet Explorer Window

Hi, I'm wondering if there is a built in way to take a GridView select buttons and have them open an IE window or tab and link a FormView Control to that link.Basically a Master-Details type of view, but in a new window instead of the same window.

Open in new window option for Image Button

I am using an Image Button with onclientclick property set.Upon clicking the button I am able to navigate to URL page. But when I am right clicking on the Image Button I am not getting "Open in new window" or "Open in new tab". These options I see when I right click on an Hyperlink control.Can we achieve the same fro Image Button. If so how?Thank you,Praveen.

How to open new browser window in asp.net mvc

I need open new browser window.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend