473,781 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.PreviousPa ge 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 2555
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
8554
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 available homes and properties in a given area. I put these form fields into User Controls because they will be repeated in different ways throughout the site and it would be nice to only update the fields from one place to make a site wide change.
3
1544
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 good straight forward example. Does anyone know how to do this? I'm using asp.net 2.0 and vb.net. Thanks.
0
1259
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 header, the body, and the footer. The header and footer are user controls created by one of our developers, and contain things that all the pages in our web app should contain. This is done to avoid inconsistencies (so you only change the header once...
1
2207
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 applications. Let me try to briefly explain how each page is laid out... Usually within the page, there are 3 components... The header, the body, and the footer. The header and footer are user controls created by one of our developers, and contain...
0
1315
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, the body, and the footer. The header and footer are user controls created by one of our developers, and contain things that all the pages in our web app should contain. This is done to avoid inconsistencies (so you only change the header once...
0
962
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 unfortunately, the 2nd time it is fired the "PreviousPage" is set to Nothing. Is this a known bug? Does anyone know a workaround for this?
4
5350
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" When the second page opened, and tried to get a hidden value on the previous page, I got the following error:
2
2675
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 url that looks like the following: PostBackUrl=somepage.aspx?param=<valuewhere <valuecomes from the currently selected item in the list. Thanks, Rob
4
4128
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 getting access to the Button that was clicked, because I cannot use the PreviousPage.FindControl() method since I do not know the id of the Button. What can I do to get access to a Button that was inside a Repeater? Thanks. Nathan Sokalski...
0
9639
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10143
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.