Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
190 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
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…
Suggested Courses

609 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