Solved

ASP.Net - How can I keep my whole page with grids in viewstate or cache page?

Posted on 2009-04-01
9
186 Views
Last Modified: 2012-05-06
Hello all,

I have a tabbed page where when the user goes to a second tab and back to the first the grids reset and all the dropdowns go back to defaults etc.  Is there a way to somehow cache the page or viewstate etc. the controls?   I need some detailed information so I can try it thanks all.  Just for the day is fine I guess if caching is the way to do it or like a few hours or something.  I just want the user to be able to go to two tabs on that page and it keeps the control selections somehow.
0
Comment
Question by:sbornstein2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 24038369
How do you do the tabbing? Because it sounds as opening a tab is a roundtrip to the server.

You can do tabbing also with hiding and displaying divs through javascript (without doing a roundtrip to the server).
0
 

Author Comment

by:sbornstein2
ID: 24038397
The tabbing really is just a control that actually loads an ASPX page so it really is like a redirect the page completely reloads.  So on the page that I want cache only the first tab (again it just goes to its own aspx page and the tab control is on both aspx pages) on the page I want cache or viewstate whatever I have gridviews that have checkboxes in them three gridviews in total and then two dropdowns.  When the user goes back to the page I want those values to stay somehow.  Is there a way to cache the whole page or is it harder than that and I need to cache all the checked checkboxes, selected values etc?
0
 
LVL 28

Expert Comment

by:sybe
ID: 24038496
So you want to keep the viewstate of two different pages as if it were a single page? That is going to be hard. And if you maybe are going to add more tabs in the future, things are getting only more complicated.

You could read the viewstate of page1 from the Request.Form and store it in a hidden formfield in page2, and then with javascript - when going back to page1 - exchange the stored value of the viewstate of page1 with the viewstate of page2 that is posted. But I don't know if it is possible to manipulate the viewstates that way. And you might quickly get an enormous viewstate in the pages.

Or you could read out all relevant formvalues (how many are there?) from page1 and store them in a hidden form field in page2, read them out when going back to page1.

Isn't is a lot easier to have the tabs with hiding/displaying divs with javascript? I think it is.



0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:sbornstein2
ID: 24038629
well my tabs look very good based on the control I found where I can set the style settings etc.  Not sure what other tab control I could use to handle that.  Right now this tab control dll I found will direct to another page.
0
 

Author Comment

by:sbornstein2
ID: 24038701
most of the tab controls I have found even the ajax control kit they all post to another URL.
0
 
LVL 28

Expert Comment

by:sybe
ID: 24038730
Hmmm. I start to think that we are living on a different planets. In my world styles are done by CSS directly, not by setting styles to a control, which then translates them to CSS while the control is translated to HTML.

Maybe it is a bit hard to explain that I do like the freedom of writing HTML, CSS and javascript directly, that it is not that hard and that asp.net does not need to process directly written HTML, CSS and javascript.
0
 

Author Comment

by:sbornstein2
ID: 24038873
I am using thw following control set http://www.codeproject.com/KB/custom-controls/FormTabs.aspx.  This as well as other tab controls I have found postback to a different URL per tab.  So unless you know of a client side one that would help great otherwise I need to somehow store the checked values of grids and controls.  That is the point of my question.
0
 
LVL 28

Accepted Solution

by:
sybe earned 500 total points
ID: 24039115
0
 

Author Closing Comment

by:sbornstein2
ID: 31565276
I ended up using the Ajax Control Kit and it's tab control with content containers now on one page.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question