Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-10-30
4
Medium Priority
?
3,587 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:Murray Brown
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39612900
try:

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

Author Comment

by:Murray Brown
ID: 39613511
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 2000 total points
ID: 39613903
change it to :

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

Author Closing Comment

by:Murray Brown
ID: 39621613
thanks very much
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Integration Management Part 2
Loops Section Overview
Suggested Courses

916 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