{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
Transferring control from one page to another
Summary
Transferring control from one aspx page to another is a pretty common need. This piece looks at one scenario.
 
Table of Contents

User won’t see the real URL

User sees the real URL

 

There are two scenarios for taking the user from one page to another:

User won’t see the real URL

You don’t want the user to know the real page you are transferring the control to. That is, the URL window of the browser wouldn’t show the address of the page you have really transferred the user to. For example, the browser URL shows specal-customer.aspx, but you have actually transferred the user to customer.aspx?type=special.

The re-writing of path (RewritePath) is described in the following article:

http://www.infinitezest.com/articles/some-quick-and-easy-ways-to-rewrite-urls.aspx

User sees the real URL

In this second case, you want to transfer the control to entirely different page. With this, the user will, of course, see the url in browser’s url window. This can be accomplished by setting the Redirect method of the Response object that is available from an aspx page.

Response.Redirect(@"~\ArticleListing.aspx");

Bookmark and Share This

More Articles With Similar Tags
icon-fiddler-googlebot-http-request-results.jpg
RewritePath used to service search engine friendly urls has problems with search engines. While this works fine with regular browsers, the request fails with the user agents of most all search engines. This article looks at the workarounds (fix from Microsoft was not available by early 2007)
icon-fiddler-results.jpg
Fiddler lets you capture the HTTP traffic on your computer very easily. You would be able to test how your site responds to requests from search engines very easily (by putting that user-agent string in the HTTP request). In addition, what’s discussed in this article can be used to debug things like the problems with RewritePath.
With ID as a query string parameter (...aspx?ID=...) being a big no-no from the search engine perspective, we would need a way to convert the convenient fake urls into the ones our system understands (like using ID= in the url). There are several ways of accomplishing this; we will look at a couple of quick options.
About  Contact  Privacy Policy  Site Map