Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2005, 04:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default C# Help needed in aspx page

I am trying to convert this line of ASP code into my aspx.cs page so that when the user clicks on the RETRY button on the web page it goes back to the last page they were on:

strHTTP = trim(Request.ServerVariables("HTTP_REFERER"))

<input Type="Button" Value="Retry" Name="Retry" onClick="window.location='<%=strHTTP%>'">

How do I do the same thing in my .aspx page?

Any help would be appreciated.

Regards.
 
Old January 21st, 2005, 10:55 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

I am trying to understand: Is server variables really need for this situation. Can't we directly use javascript and move to previous page!

Something like, history.back() or history.go(-1)

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 24th, 2005, 10:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for the reply however I am getting a compilation error stating the following:

CS0117: 'ASP.errorhandle_aspx' does not contain a definition for 'history'

<td align="center">
Line 42: <asp:Button ID="retryButton" Runat="server" Text="Retry" onClick="history.back()"></asp:Button><br>
Line 43: <br>
Line 44: </td>

Do I need to create a JS function? Any help would be appreciated.

Regards.
 
Old January 28th, 2005, 02:34 PM
Authorized User
 
Join Date: Jan 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Use the following code :

onClick="javascript:history.back()"



Hope It Helps !!
Bhaskar Ghosh





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass variables from Aspx page to Asp Page jayaraj Classic ASP Basics 2 May 23rd, 2004 06:56 AM
How to pass the variables in Aspx page to Asp Page jayaraj ASP.NET 1.0 and 1.1 Basics 3 May 23rd, 2004 06:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.