CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Return Page Switcheroo

Print topic Send  topic

Author Message
rclayh

Posts: 8
Posted: 04/08/2005, 7:29 AM

Here's a simple fix for one of CC's missing features. I often want to call a maintenance page from someplace else and go back to it. You can set the RedirectURL but your keys get dropped. Here is a simple piece of code that you can drop in the OnClick event of your buttons and it'll will allow you to pass in a ReturnPage in the query string and come back to it with your keys in tact.

Dim RawURL as String = System.Web.HttpContext.Current.Request.RawUrl
Dim KeyReturnString as String = ""
Dim ReturnPage As String
Try
ReturnPage = System.Web.HttpContext.Current.Request.QueryString("ReturnPage")
'Add the query string part of the RawURL
Dim BreakPoint as Integer = Instr(1,RawURL,"?")
KeyReturnString = Mid(RawURL, Breakpoint + 1)
ReturnPage = ReturnPage & "?" & KeyReturnString
RedirectUrl = (ReturnPage).ToString()
Catch
'ReturnPage not found don't do a dang thing
End Try

This is VB.Net but should be easy enough to translate to C# (if you're bent that way).

If you know of an easier way please post. Thanks,

Clay
View profile  Send private message
rclayh

Posts: 8
Posted: 04/14/2005, 6:15 AM

Error in code this works...

'version 2
Dim RawURL as String = System.Web.HttpContext.Current.Request.RawUrl
Dim KeyReturnString as String = ""
Dim ReturnPage As String
Try
ReturnPage = System.Web.HttpContext.Current.Request.QueryString("ReturnPage")
If ReturnPage.Trim().Length() > 0 Then
'Add the query string part of the RawURL
Dim BreakPoint as Integer = Instr(1,RawURL,"?")
KeyReturnString = Mid(RawURL, Breakpoint + 1)
ReturnPage = ReturnPage & "?" & KeyReturnString
RedirectUrl = (ReturnPage).ToString()
End If
Catch
'ReturnPage not found don't do a dang thing
End Try
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.