asp.net session problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!!
 
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.
 
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
 
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!!
 
Back
Top