473,406 Members | 2,259 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,406 software developers and data experts.

asp.net session problem

Hi, i have some problem in asp.net session problem

in page_load ->
i have
Label1.text = Session("a")

in DataGrid1_sortCommand ->
i have
Session("a") = e.sortExpression

the problem is:
when I click the column header the first time, "label1.text" doesn't show
anything
but when i click the second time, it shows the result of the previous click

seems that the session is updated "one step lag behind"
how can i solve it? or i have bad concept?
thanks a lot!!
Nov 19 '05 #1
4 1404
Hi,
Its clear from the code that it will show the value with one lag
behind.
As the handler will be called after the page load and you are
retrieving the value from the session in page load and setting it in
event handler.

So what i think is just set the value and retrieve the value in event
handler itself.

HTH
Angrez

Nov 19 '05 #2
"=?Utf-8?B?YWxhbg==?=" <al**@discussions.microsoft.com> wrote in
news:49**********************************@microsof t.com:
seems that the session is updated "one step lag behind"
how can i solve it? or i have bad concept?


You have a bad concept - you should update the label after you do your
sort. Not prior.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #3
yes, thanks!

but now i have to deal with the pages of the datagrid as well as sorting
because when i go to "next page" after sorting, the table becomes the
original unsorted one, but not sorted
so, how can I solve the problem?

thanks a lot again!!

"si**********@rediffmail.com" wrote:
Hi,
Its clear from the code that it will show the value with one lag
behind.
As the handler will be called after the page load and you are
retrieving the value from the session in page load and setting it in
event handler.

So what i think is just set the value and retrieve the value in event
handler itself.

HTH
Angrez

Nov 19 '05 #4
thanks all

i have solved the problems!

"alan" wrote:
Hi, i have some problem in asp.net session problem

in page_load ->
i have
Label1.text = Session("a")

in DataGrid1_sortCommand ->
i have
Session("a") = e.sortExpression

the problem is:
when I click the column header the first time, "label1.text" doesn't show
anything
but when i click the second time, it shows the result of the previous click

seems that the session is updated "one step lag behind"
how can i solve it? or i have bad concept?
thanks a lot!!

Nov 19 '05 #5

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

Similar topics

7
by: Billy Jacobs | last post by:
I am having a problem with my session variable being set to Null for no apparent reason. I am declaring it like the following when the user logs in. dim objUserInfo as new clsUserInfo 'Set...
1
by: Scott Wickham | last post by:
I'm having a problem saving session information on one form and retrieving it on a subsequent form...for only one out of a number of users. Actually, I'm not absolutely certain it's a session...
6
by: Lina Manjarres | last post by:
Hello, I have a session variable in a login page. Then I go to a form page where I uses the ProfileID and the UserID. Then I go to a result page where I would like to use the UserID as a filter,...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
5
by: Mark Rodrigues | last post by:
Hi Everyone, I have been fighting a problem for a while and I wonder if someone out there can help. This problem has been presented in a number of news postings previously but I am yet to see a...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
1
by: Werner | last post by:
Hi Patrick! Can you give an example of how to use a frameset inside an aspx-file? When I create a new frameset in Visual Studio.Net it just gives me a htm-File. Or give me a link where I can...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
5
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to...
7
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below,...
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: 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
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...
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
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...
0
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...
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,...
0
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...

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.