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

Context.Items and Postbackurl in ASP.NET 2.0

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.FindControl(...). 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 3 '06 #1
0 1243

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

Similar topics

8
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...
2
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
4
by: nicholas | last post by:
I'm using context to transfer variables from 1 page to another. But, with more than 2 pages it fails. Ex: page1.aspx: Context.Items.Add("customername", customername.text)...
1
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...
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,...
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" ...
3
by: jobs | last post by:
I have a gridview with data that's a link to another page. I want to pass search information to the called page, but I don't want that query string to remain in the address line beyond the...
2
by: noneya22 | last post by:
I'm using asp.net 2.0. I have a page that has a save button and a cancel button along with a text field. All controls are asp.net server controls. I have JavaScript that prompts the user if he...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
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
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...
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.