Access Value of a control on another page

R

RSH

I have a situation where I have a page called "HiddenFrame.aspx" that
contains a public property exposing the value of a textbox called "TextBox1"
that is in a hiddenframe.

Loaded in the main frame is a page called "Page1.aspx" in which from the
code behind I need to set the value of "TextBox1" which will be persistent
following the initial setting.

How can I set the value of that textbox in the hiddenframe?

Will I need to do it from the clientside?

Thanks Ron
 
P

Peter Bradley

This doesn't really address the problem you raise, but I wonder if you had
considered creating your own server side object in which to store values
like these. I am assuming that these values that you want to access
represent some state information and that that state information is saying
something about an object that your application is modelling.

Life becomes much easier when you do this, because everything is in the
right place. The client (browser) contains only presentation data: the
server (ASP.NET server-side) holds all Session or Application-related data:
the business data goes into the business layer (perhaps on an application
server): and data access data in the data layer (again, perhaps on a
differenct server altogether).

Once you've split things up in this way, it is easy to access any datum,
because it will be located exactly where you left it. It also greatly
simplifies the markup on the client side because the client side only
concerns itself with presenting the data; not storing or maintaining it.

Just my 2c. YMMV.


Peter
 
R

RSH

Peter,

Thanks for your reply.

Normally I would implement what you are saying but my issue is really trying
to get around a particular problem with the potential of crossed up
sessions.

In the new series of browsers they introduced these damn tabs. I have a
situation where multiple users are using the same computer, and they are
using my web application in which they are authenticating through. The
situation has arisen on more than one occassion in which a user has logged
in and has a current session. A second user opens a new tab or window and
logs in, does what they are supposed to do then closes out. Now because
user 2 logged in in the same instance of the browser a second unique session
is NOT created it simply uses the SessionID of the first user and overwrites
all of the session information from the first user. Once the second user
closes the window, you would think their session would terminate but in
actuality the session remains open because the first user is still logged
in...worse yet the first user comes back and starts entering data thinking
they are working with their session, but since user2 logged in user1 is
actually using user 2s session.

So with that being said I was trying to figure out a way to persist the user
id in a hidden frame and then on every page load i can compare the session
variable that contains their user name against the persisted username and if
they dont match they are logged out, forcing them to re login and set the
session vars up correctly.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top