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

Cross page data: Session, Viewstate or something else?

Hello,

I have a webapp with on each page a "language" drop down list. Now, if I
choose X, I want to initialise the drop down list to X. Easy to understand.
But what is the best way to do this in ASP.NET? The obvious answer is, I
think, the Session object. But one thing annoys me: a session can expire. It
is difficult to guess the expiration time; 20 minutes, 40, 60? I just don't
know. Is there a better way to pass data between pages? I was thinking about
the good old url parameters: page.aspx?language=en. But I don't think that's
the ASP.NET way.

Ideas, suggestions and comments more than welcome.



Nov 18 '05 #1
3 1626
If you are talking about small amounts of data, passing it in the URL is
fine.

It is not difficult to guess the expiration time of a session, since that is
a setting you configure

"Zaccariah Kowalsky" <g-***@freegates.be> wrote in message
news:bp**********@news.worldonline.be...
Hello,

I have a webapp with on each page a "language" drop down list. Now, if I
choose X, I want to initialise the drop down list to X. Easy to understand. But what is the best way to do this in ASP.NET? The obvious answer is, I
think, the Session object. But one thing annoys me: a session can expire. It is difficult to guess the expiration time; 20 minutes, 40, 60? I just don't know. Is there a better way to pass data between pages? I was thinking about the good old url parameters: page.aspx?language=en. But I don't think that's the ASP.NET way.

Ideas, suggestions and comments more than welcome.


Nov 18 '05 #2
Marina <nospam> schreef in berichtnieuws
O2**************@TK2MSFTNGP10.phx.gbl...
If you are talking about small amounts of data, passing it in the URL is
fine.

It is not difficult to guess the expiration time of a session, since that is a setting you configure
It is. You never know how long a customer will stay on your site. 5 minutes
or 2 hours?
"Zaccariah Kowalsky" <g-***@freegates.be> wrote in message
news:bp**********@news.worldonline.be...
Hello,

I have a webapp with on each page a "language" drop down list. Now, if I
choose X, I want to initialise the drop down list to X. Easy to understand.
But what is the best way to do this in ASP.NET? The obvious answer is, I
think, the Session object. But one thing annoys me: a session can

expire. It
is difficult to guess the expiration time; 20 minutes, 40, 60? I just

don't
know. Is there a better way to pass data between pages? I was thinking

about
the good old url parameters: page.aspx?language=en. But I don't think

that's
the ASP.NET way.

Ideas, suggestions and comments more than welcome.



Nov 18 '05 #3
The session timer is reset each time a user request a
page, so it is perfectly normal to keep your currently
selected language in the session. The session expires if
the user doesn't request a page for longer than X minutes
where X is your session timeout period which is by default
set to 20 minutes.

You could keep the language in the viewstate but it will
not be easily accessible from nested child controls and
such. Since the selected language is more of a global
variable that all pages and controls probably use the
Session is the best way to keep it.
-----Original Message-----
Marina <nospam> schreef in berichtnieuws
O2**************@TK2MSFTNGP10.phx.gbl...
If you are talking about small amounts of data, passing it in the URL is fine.

It is not difficult to guess the expiration time of a session, since that
is
a setting you configure
It is. You never know how long a customer will stay on

your site. 5 minutesor 2 hours?
"Zaccariah Kowalsky" <g-***@freegates.be> wrote in
message news:bp**********@news.worldonline.be...
> Hello,
>
> I have a webapp with on each page a "language" drop down list. Now, if I > choose X, I want to initialise the drop down list to X. Easy to
understand.
> But what is the best way to do this in ASP.NET? The
obvious answer is, I > think, the Session object. But one thing annoys me: a

session canexpire.
It
> is difficult to guess the expiration time; 20

minutes, 40, 60? I just don't
> know. Is there a better way to pass data between
pages? I was thinking about
> the good old url parameters: page.aspx?language=en.
But I don't think that's
> the ASP.NET way.
>
> Ideas, suggestions and comments more than welcome.
>
>
>
>
>
>
>


.

Nov 18 '05 #4

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

Similar topics

3
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
1
by: Satish Appasani | last post by:
Is there any ideal way of passing values to another page using Post method and avoiding Sessions and Viewstate? I have used Viewstate unsuccessfully. Though I've set all the required attributes...
4
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
7
by: Brian Henry | last post by:
Hi, I have a data grid that has the following properties EnableViewState = false AllowPaging = true AllowSorting = true AllowCustomPaging = false now, when the page switches I want to get...
3
by: kermit | last post by:
Hi, I am hoping this is a foolish or simple question. I am creating a multiuser app. consisit of a login page and a dataentry page. If the user leaves the data entry page (other than exiting the...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
6
by: bill | last post by:
Is there a way to retrieve values from the viewstate in the previouspage using cross page postback? Thanks! Bill
7
by: Shadow Lynx | last post by:
I realize that his question has been asked, in many other forms, many times in this group. Even so, my tired eyes have not yet found a sufficient answer, so I've decided to "reask" it even though...
2
by: J055 | last post by:
Hi I'd like to post a page to another page using LinkButton.PostBackUrl. Then using another LinkButton on the target page post back to the source page and restore the controls to the state they...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.