?
Solved

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

Posted on 2009-04-01
9
Medium Priority
?
192 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 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