473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Server.Transfer chaging URL in address bar

I have an ASP.Net 1.1 site that uses Server.Transfer() heavily. Specifically,
I use a page called /misc/pagenotfound.aspx to implement logic that maps URLs
of the format /vdir/california to a physical page, called with the format
/vdir/state.aspx?id=CA. The first of these URLs can be used to call up the
page by the visitors. Because this page doesn't exist PageNotFound.aspx is
loaded (I have configured this in web.config), which uses Server.Transfer to
invoke the state.aspx page (the physical page on my server). Here's the
important part - the address bar in the browser still displays
/vdir/california so all this plumbing is hidden to the visitor. That's
exactly what I want.

However, now that I am using the same page on an ASP.Net 2.0 site I am
seeing a different behaviour. The state.aspx file is still called and the
correct content (based on id=ca) is displayed. However, the address bar
displays the URL to PageNotFound. aspx - /vdir/california is not displayed.

How can I ensure that the actually URL used by the visitor remains in the
address bar, even when Server.Transfer is used?

Thanks.
May 28 '07 #1
3 1697
It sounds, to me, like you are throwing an error and the error is sending
the person to the "not found" page. Is that a possibility in the coding of
your application?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Mark" <Ma**@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
>I have an ASP.Net 1.1 site that uses Server.Transfer() heavily.
Specifically,
I use a page called /misc/pagenotfound.aspx to implement logic that maps
URLs
of the format /vdir/california to a physical page, called with the format
/vdir/state.aspx?id=CA. The first of these URLs can be used to call up the
page by the visitors. Because this page doesn't exist PageNotFound.aspx is
loaded (I have configured this in web.config), which uses Server.Transfer
to
invoke the state.aspx page (the physical page on my server). Here's the
important part - the address bar in the browser still displays
/vdir/california so all this plumbing is hidden to the visitor. That's
exactly what I want.

However, now that I am using the same page on an ASP.Net 2.0 site I am
seeing a different behaviour. The state.aspx file is still called and the
correct content (based on id=ca) is displayed. However, the address bar
displays the URL to PageNotFound. aspx - /vdir/california is not
displayed.

How can I ensure that the actually URL used by the visitor remains in the
address bar, even when Server.Transfer is used?

Thanks.

May 29 '07 #2
Actually, yes, but that is by design. I have configured the defaultRedirect
element in eb.config and the page I have entered is being called for all
errors, as hoped. The codebehind for the pagenotfound.aspx file then kicks in
to parse the original URL to map it to the physical URL. This all seems to be
working just fine because the correct page is being displayed. The "only"
problem I have is that the original URL entered should remain in the browsers
address bar but, instead, I am seeing a reference to pagenotfound.aspx.

So, to sum this up, the only error is the regular 404 (page not found) I am
anticipating and coding for. But I can't stop the pagenotfound.aspx file
showing up in the address bar.

Thanks.

Mark

"Cowboy (Gregory A. Beamer)" wrote:
It sounds, to me, like you are throwing an error and the error is sending
the person to the "not found" page. Is that a possibility in the coding of
your application?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Mark" <Ma**@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
I have an ASP.Net 1.1 site that uses Server.Transfer() heavily.
Specifically,
I use a page called /misc/pagenotfound.aspx to implement logic that maps
URLs
of the format /vdir/california to a physical page, called with the format
/vdir/state.aspx?id=CA. The first of these URLs can be used to call up the
page by the visitors. Because this page doesn't exist PageNotFound.aspx is
loaded (I have configured this in web.config), which uses Server.Transfer
to
invoke the state.aspx page (the physical page on my server). Here's the
important part - the address bar in the browser still displays
/vdir/california so all this plumbing is hidden to the visitor. That's
exactly what I want.

However, now that I am using the same page on an ASP.Net 2.0 site I am
seeing a different behaviour. The state.aspx file is still called and the
correct content (based on id=ca) is displayed. However, the address bar
displays the URL to PageNotFound. aspx - /vdir/california is not
displayed.

How can I ensure that the actually URL used by the visitor remains in the
address bar, even when Server.Transfer is used?

Thanks.


May 29 '07 #3
I should clarify what I meant here. There is no "intentional" (coded)
throwing of errors happening here. The only error involved is a 404 (Page Not
Found) and my entry in web.config is there to tell the system how to handle
that event. As I mentioned in the open message here, all the plumbing seems
to be in place because I do see the correct content, as parsed/redirected by
my pagenotfound.aspx file. The problem I have is that the address bar shows
as follows:

http://<site>/misc/pagenotfound.aspx?aspxerrorpath=/articles/songs.aspx

What I expect to see in the address bar is:

http://<site>/articles/songs.aspx

which is what happens on my ASP.Net 1.1 site.

Any ideas?

Thanks.
"Mark" wrote:
Actually, yes, but that is by design. I have configured the defaultRedirect
element in eb.config and the page I have entered is being called for all
errors, as hoped. The codebehind for the pagenotfound.aspx file then kicks in
to parse the original URL to map it to the physical URL. This all seems to be
working just fine because the correct page is being displayed. The "only"
problem I have is that the original URL entered should remain in the browsers
address bar but, instead, I am seeing a reference to pagenotfound.aspx.

So, to sum this up, the only error is the regular 404 (page not found) I am
anticipating and coding for. But I can't stop the pagenotfound.aspx file
showing up in the address bar.

Thanks.

Mark

"Cowboy (Gregory A. Beamer)" wrote:
It sounds, to me, like you are throwing an error and the error is sending
the person to the "not found" page. Is that a possibility in the coding of
your application?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
"Mark" <Ma**@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
>I have an ASP.Net 1.1 site that uses Server.Transfer() heavily.
>Specifically,
I use a page called /misc/pagenotfound.aspx to implement logic that maps
URLs
of the format /vdir/california to a physical page, called with the format
/vdir/state.aspx?id=CA. The first of these URLs can be used to call up the
page by the visitors. Because this page doesn't exist PageNotFound.aspx is
loaded (I have configured this in web.config), which uses Server.Transfer
to
invoke the state.aspx page (the physical page on my server). Here's the
important part - the address bar in the browser still displays
/vdir/california so all this plumbing is hidden to the visitor. That's
exactly what I want.
>
However, now that I am using the same page on an ASP.Net 2.0 site I am
seeing a different behaviour. The state.aspx file is still called and the
correct content (based on id=ca) is displayed. However, the address bar
displays the URL to PageNotFound. aspx - /vdir/california is not
displayed.
>
How can I ensure that the actually URL used by the visitor remains in the
address bar, even when Server.Transfer is used?
>
Thanks.
May 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: \A_Michigan_User\ | last post by:
Ok, I give up... why do 1-4 work fine... but 5-6 give "can't find" errors? 1. Client-side VBscript code: call navigate("\\209.11.22.33\MyDir") 2. Client-side VBscript code: location.href...
4
by: Bob H | last post by:
Hi, I'm aware of the different ways to pass variables between ASP.Net pages. For pages that need to pass a variable, we're using the server.transfer method. For others, we're using...
4
by: john | last post by:
I have an app that uses Server.Transfer from page1 to page2. page2 needs to be able to read all the values from page1's form. The problem is, if the user clicks the back button on page2 after a...
2
by: Ryu | last post by:
Hi, it seems that Server.Transfer only preserve the url only for 1 hop. For example I have A.aspx, B.aspx and C.aspx. If i do a server.transfer at A.aspx to B.aspx Server.Transfer("B.aspx") the...
3
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
3
by: qqq | last post by:
In a web app. I have a 'master' form (EventDetail.aspx) which displays existing bookings for an event. If the user clicks on a booking they are taken (with a server.transfer) to Booking.aspx which...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
8
by: p3t3r | last post by:
I am using .NET2 and have a number of aspx pages. On each page is a LinkButton that performs a server.transfer() to another page. If we use page names A,B,C,D,E as an example. I start on page A...
5
by: JX | last post by:
Is it possible to replace the address in client browser for server.transfer with the the real location?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.