Solved

VB.NET Open Page Code

Posted on 2004-04-13
6
1,022 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
Comment Utility
In a button code put
Respond.Redirect("yourpage.aspx")
0
 
LVL 28

Accepted Solution

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

Assisted Solution

by:esteban_felipe
esteban_felipe earned 25 total points
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:gaz_sellout
Comment Utility
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
Comment Utility
Is this in a ASP.NET application?


AW
0
 

Expert Comment

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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now