473,591 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PostbackUrl and Context.Items

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 things that all the pages in our web app should
contain. This is done to avoid inconsistencies (so you only change the header
once instead of changing it 20 times - once for each page).

The developer who created the header user control used Context.Items to
store some information. On my pages, I am trying to use PostbackUrl to post
form information from one page to another.

The problem I am having is this:
Both my pages call the header control. When I use PostbackUrl and
PreviousPage, I think the header control from the previous page gets "copied"
over to the page I am posting to. So in the second page, I get something like
a "dictionary keys have to be unique" exception. I think this is because the
Context.Items wasn't "cleared" from the PreviousPage since it was "copied"
over, so when the header user control tries to add the same key to
Context.Items in the second page, I get an exception.

I temporarily solved this problem by using Request.Form[...] rather than
PreviousPage.Fi ndControl(...). I'm not sure if this is the right way to do
it, or if it will cause any problems.

So my question is: Can PostbackUrl and Context.Items work together? I guess
I could put some try/catch statements in the header control, but
unfortunately I don't have access to that file.

Thanks for your help!
Apr 5 '06 #1
1 2193
Wendy wrote:
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


There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.publi c.dotnet.framew ork.aspnet.

Unfortunately, I do not know the answer to your question.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Apr 5 '06 #2

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

Similar topics

8
10083
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for a text box has 6 items, undo, cut, copy, paste, delete and select all. I would like to add one additional paste menu that opens a new sub menu with several optional text items that could be pasted. The items would be populated by my program but...
2
1702
by: dave | last post by:
This little problem is driving me nuts!! On my webform page I create 2 variables.. Protected p_dml As String = "I" Public Const mwv_id As Integer = 0 ' originally had mwv_id as Protected
1
6325
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel etc'). is there a way making this without writing my own context menu (meaning, popup form or something) ? Please don't post commercial products to this topic thanks.
1
8534
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.
0
1251
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...
0
1308
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...
4
5334
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:
1
4765
by: Chris | last post by:
Hi, i created an ImageButton within an ItemTemplate of a datalist (in shop.aspx). There are two possibilities: 1) when the user is logged and he clicks on an image, he must be 'postbacked' to another file showing that same picture in big size and with more info.. 2) when not logged and clicking on an image, he must be 'postbacked' to the login page (log.aspx).
0
1342
by: George | last post by:
Can not figure out why but if I have button with PostBackUrl specified it breaks UrlRewrite. All buttons stop working. Form submits but corresponded event procedure never called. And it only happens in rewritten urls. Do not understand why it a happens, hope some one from Microsoft would took a look at it. I spent about a day trying to pinpoint a problem. Finaly did. Here are simple steps to reproduce the problem 1. Create project...
0
7934
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
8236
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
8362
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...
1
7992
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8225
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...
1
5732
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
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();...
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.