Groups | Blog | Home
all groups > asp.net > april 2005 >

asp.net : asp.net session problem


alan
4/20/2005 11:14:02 PM
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?
singh_angrez NO[at]SPAM rediffmail.com
4/20/2005 11:37:54 PM
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
Lucas Tam
4/21/2005 12:00:00 AM
"=?Utf-8?B?YWxhbg==?=" <alan@discussions.microsoft.com> wrote in
news:4997E07A-A377-49C7-8937-BA074B8F36EE@microsoft.com:

[quoted text, click to view]

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

--
Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
alan
4/21/2005 1:36:01 AM
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!!

[quoted text, click to view]
alan
4/21/2005 2:30:03 AM
thanks all

i have solved the problems!

[quoted text, click to view]
AddThis Social Bookmark Button