473,387 Members | 1,344 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.

PostBackURL, Server.Transfer, and PreviousPage

Here is the setup:

I have an SQL driven sitemap provider - when the user clicks on a
database generated link - /Site/DBPages/Article1.aspx - a handler does
a Server.Transfer - Server.Transfer("/Site/Template.aspx", true) - to a
template page which displays the database related content. The
Template page knows it's content because the page does exist in the SQL
sitemap provider.

The problem comes in with a button on /Site/Template.aspx - by default
it will post back to "/Site/Template.aspx" instead of the user's URL
bar value "/Site/DBPages/Article1.aspx" - so I set the button's
PostBackURL to "/Site/DBPages/Article1.aspx" and the page posts to the
correct page ok.

But Page.PreviousPage is null, Page.IsPostBack is false, and there is
no event information on the button click. Request.Params does have a
__PREVIOUSPAGE - it's just not getting used it seems.

I think the Server.Transfer on the postback is stripping off the
PreviousPage, but I'm not sure.

Mike

May 12 '06 #1
1 2540
After all weekend of looking, the solution (workaround) I've come up
with is to look though the Request.Params for the name of the button
(which requires a little logic on it's own to parse the name from the
..net string) and then manually do all processing from Request.Params
ASP 1.1 style. This feels like a dirty hack, and I'm left wondering
if this is the way it's supposed to work or it's a bug.

Mike

May 15 '06 #2

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

Similar topics

1
by: osh | last post by:
All, I am having trouble using the PostBackUrl feature in .NET 2.0. I have several User Controls that are on a MasterPage. The User Controls contain the form fields for a basic search on...
3
by: lanem | last post by:
I want to use server.transfer to go to a new aspx page. I want to be able to still have the viewstate from the previous page. I have researched this and see a lot about it, but I can't find a...
0
by: wendylau81 | last post by:
We are currently using ASP.NET 2.0 to revamp one of our web applications. Let me try to briefly explain how each page is laid out... Usually within the page, there are 3 components... The...
1
by: Wendy | last post by:
I had previously posted this in inetserver.asp.components, I don't think that was the right place... anyways, here is a repost: We are currently using ASP.NET 2.0 to revamp one of our web...
0
by: Wendy | last post by:
We are currently using ASP.NET 2.0 to revamp one of our web applications. Let me try to briefly explain how each page is laid out... Usually within the page, there are 3 components... The header,...
0
by: cmay | last post by:
I have a page with smartNav, that contains a linkbutton with a PostBackUrl. I have found that the page that is the target of the PostBackUrl will have it's postback property fired 2 times, and...
4
by: sck10 | last post by:
Hello, Can you use the PostBackUrl to post to different sites? I have a page (PostBackURL.aspx' ) on one website (same server) that has a button set to: PostBackURL="http://zone1.web.com" ...
2
by: rob | last post by:
Hi, I have a button whose PostBackUrl should include a value from a dropdownlist on the same page. Should I do that in the button's on click event? What I'd like to end up with is a post back...
4
by: Nathan Sokalski | last post by:
I have a Button that uses the PostBackUrl property which is inside a Repeater template. When I get to the Page that is being posted to (the one specified in PostBackUrl), I am having trouble...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.