Solved

ASP.net VB.net Open web page behind button click in new tab or browser

Posted on 2013-10-30
4
3,318 Views
Last Modified: 2013-11-04
Hi
I use the following VB.net code to behind a button click to open a web page
Response.Redirect("Page1.aspx")

I need to open the page in a new browser or tab.
How do I do that?
0
Comment
Question by:murbro
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
Comment Utility
try:

Dim script As String = "window.open('Page1.aspx');"
ClientScript.RegisterStartupScript(cstype, "open", script, True)
0
 

Author Comment

by:murbro
Comment Utility
Hi. Thanks. I get the following error

Error      23      'cstype' is not declared. It may be inaccessible due to its protection level.      C:\Users\murbro\Documents\Visual Studio 2010\Projects\GREAT\GREAT\GREAT_Page.aspx.vb      109      48      GREAT
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
Comment Utility
change it to :

ClientScript.RegisterStartupScript(Me.GetType(), "open", script, True)
0
 

Author Closing Comment

by:murbro
Comment Utility
thanks very much
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now