?
Solved

VB.NET Open Page Code

Posted on 2004-04-13
6
Medium Priority
?
1,048 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 400 total points
ID: 10814071
sorry typo
must be
Response.Redirect("yourpage.aspx")
0
 
LVL 12

Assisted Solution

by:esteban_felipe
esteban_felipe earned 100 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
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 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