473,396 Members | 1,738 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,396 software developers and data experts.

ensure a parameter gets passed between pages

I'm trying to keep pages in sequence to make sure sessions don't
overlap if a user has 2 browsers running at the same time. The hitch
I'm coming across is when they change pages, either through post back
or an anchor.

I set up a HiddenField and check it when I enter and increment it when
I leave.

How could I go about injecting that field's value into the params when
I leave the page?

Sep 5 '07 #1
2 1187
I'm not exactly sure what you mean by "into the params". Do you mean
Request.Params (which combines querystring and forms elements)?

A lot of this really depends how the user is going to progress from one page
to the next - clicking a hyperlink (anchor as you called it), or posting a
form, or through something you do such as Server.Transfer or
Response.Redirect. You also have Cross-Page postbacks in ASP.NET 2.0 where
you can get a reference to the PreviousPage property of the Page class and
access your hidden field (if it is runat=server) from there.

Then you can add items to the querystring with javascript. So we may be
talking about a fairly complicated multi-faceted issue here.

It might be possible that you could just set a session variable and
increment it as each new page is reached, then check its value on the "next
page".
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"to*********@gmail.com" wrote:
I'm trying to keep pages in sequence to make sure sessions don't
overlap if a user has 2 browsers running at the same time. The hitch
I'm coming across is when they change pages, either through post back
or an anchor.

I set up a HiddenField and check it when I enter and increment it when
I leave.

How could I go about injecting that field's value into the params when
I leave the page?

Sep 5 '07 #2
Yes, I meant Request.Params.

well I'd hope I could avoid being to specific on how the user
programmer had to move between pages. I'm trying to make it
transparent. If its not transparent or minimal in impact it probably
won't be adopted.

My general goal here is to version my session so that if I open 2
windows of the same site they wont corrupt each other's session data.
So I don't think maintaining it in the session itself is will be
reliable. I'll try and think of a way to do that though.

Cross page postbacks took about 5 minutes to get working as expected,
thanks for that.

This seems like it would be very heavy for my purpose however. Really
what id like is this functionality for my one single HiddenField. I'm
doing a web app that has some rather idiotically large pages, so it
could be rather ugly. Redirect probably can be overridden to behave
consistently, but I'm skeptical of anchors which never even post
back. I could cycle through them with javascript I suppose, but that
sounds dirty.

This seems like it won't be functional enough for general consumption,
probably a dead end.

Sep 5 '07 #3

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

Similar topics

6
by: pablo | last post by:
Dear Newsgroupers, The 'main' page contains a call to a function in an included file. This function puts a html-form on the screen. Before the form gets posted (to the 'main' page) some prior...
1
by: Srini | last post by:
I have written two simple webservice functions and trying to consume them through a client piece. Both the webservice functions have similar signature....
13
by: Maxim | last post by:
Hi! A have a string variable (which is a reference type). Now I define my Method like that: void MakeFullName(string sNamePrivate) { sNamePrivate+="Gates" }
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
2
by: Cole Shelton | last post by:
Hi all, I am trying to upload roughly 20-30k of binary data up to my webservice. At first, I just took my byte array and encoded it as a base64 string and passed it into my webservice. ...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
2
by: Damon | last post by:
Help! Need this fixed ASAP. I have a GridView/DetailsView master/details form set up, with both bound to separate ObjectDataSource objects. Both the GridView and the DetailsView have a...
4
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 This the ObjectDataSource in my UserControl, <asp:ObjectDataSource ID="odsMessage" runat="server" SelectMethod="ExecuteMessage" TypeName="AH.MyNetwork.BLL.Network.Message">...
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...
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
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,...
0
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...
0
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,...

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.