Solved

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

Posted on 2009-04-01
9
181 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:sbornstein2
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:sbornstein2
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Closing Comment

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now