我期待構建一個ajax頁面;這是一個報告頁面。默認情況下,加載今天的報告。在頁面上有一個日曆控件,當用戶點擊日期時,用相應的數據重新加載gridview。這是否被認爲是良好的做法:會話對象設計模式
1) on the first page load, query the data for the page
2) put the query result in the session object and display it in a gridview
3) if the user requests new data, get new data from the query with different parameters
4) put the result of the second query in the session object and display it
5) if the user then requests the data from the first query, get it from the session object
6) do the sorting and paging with the data held in the session.
注意:每個查詢的數據將包含大約300-500行和大約15列。我想用ajax調用所有這些。有什麼建議和避免陷阱。
感謝。
您是否正在使用Session來存儲您打算在頁面之間共享的臨時信息?這聽起來像是你正在加載會話的東西,會顯示在生成數據的頁面上。如果是這樣,那麼你不應該首先將數據放入會話中。 – 2011-01-28 02:04:49
這是一個報告頁面。默認情況下,加載今天的報告。在頁面上有一個日曆控件,當用戶點擊日期時,用相應的數據重新加載gridview。 – frenchie 2011-01-28 02:20:00