Solved

VB.NET Open Page Code

Posted on 2004-04-13
6
1,028 Views
Last Modified: 2012-05-04
Does anybody know what code I can use to make a command button open another aspx page?  I suppose this is similiar to a 'link'.

Any help would be great,
Thanks,
Gareth
0
Comment
Question by:gaz_sellout
6 Comments
 
LVL 28

Expert Comment

by:iboutchkine
ID: 10814060
In a button code put
Respond.Redirect("yourpage.aspx")
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 100 total points
ID: 10814071
sorry typo
must be
Response.Redirect("yourpage.aspx")
0
 
LVL 12

Assisted Solution

by:esteban_felipe
esteban_felipe earned 25 total points
ID: 10814101
Hi gaz_sellout,

If you want to open a new window then use an usual javascript function with window.open():
<input type="button" OnClick="javascript:window.open('newpage.aspx');">


Before you ask.... No, you can't open new windows from server side code.. You could write server side code that renders the javascript function to open the new window, but IMO that's a waiste of work.


Esteban Felipe
www.estebanf.com
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:gaz_sellout
ID: 10814163
Thanks for the help guys.

The problem I have is that I must also use this for a mobile app. and 'Response.Redirect("yourpage.aspx")' throws up an error:

"Calling Response.Redirect on a postback can have unpredictable results on mobile devices and gateways. Use MobilePage.RedirectToMobilePage method instead."

However, I cannot get "MobilePage.RedirectToMobilePage" to work. Any further suggestions on this?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 10814381
Is this in a ASP.NET application?


AW
0
 

Expert Comment

by:BusyPhoto
ID: 10841330
your mobile form is already inherited from MobilePage.
just call
Me.RedirectToMobilePage(pagetoredirect)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

772 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