473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Dynamic Page (Page.ParseControls Caching)

I have a pretty tricky problem. I have a dynamically built page. I use
Page.ParseControls to parse the "entire page" (ASPX file contains only a Page
tag). ParseControls is pretty resource intensive so I would like to cache
the Page.Controls collection and reuse it on postback instead of issuing
page.parsecontrols on the source again. When I cache the Controls collection
and add the controls back to the page, the Page.Form property is null (I
don't exactly know why but there does not appear to be a way to initialize
it). I have been unable to find a solutions to this and any approaches
would be helpful. There is a form control in the controls collection but
again it is not registered with the page.
Thanks,
Justin
Oct 17 '08 #1
2 1275
this can not really be done. controls can not be reused between pages as few
if any are written to support running the page cycle twice. this is why
asp.net caches the output rather than the control.

you could parse it once, and use the control tree as a template. make copies
of each control and add to page. you would have to write a clone routine for
each control you use.

or you coudl switch to using LoadControl. which build a class file on the
first call, and resues it, so parses are no longer necessary.

-- bruce (sqlwork.com)
"JT-ARL" wrote:
I have a pretty tricky problem. I have a dynamically built page. I use
Page.ParseControls to parse the "entire page" (ASPX file contains only a Page
tag). ParseControls is pretty resource intensive so I would like to cache
the Page.Controls collection and reuse it on postback instead of issuing
page.parsecontrols on the source again. When I cache the Controls collection
and add the controls back to the page, the Page.Form property is null (I
don't exactly know why but there does not appear to be a way to initialize
it). I have been unable to find a solutions to this and any approaches
would be helpful. There is a form control in the controls collection but
again it is not registered with the page.
Thanks,
Justin
Oct 17 '08 #2
Bruce,
Thanks for your reply. I think the clone routines would work, lot of work
but they would probably work. As for the LoadControl method, doesn't this
require an actual usercontrol to be created or am I missing something.

Thanks again,
Justin

"bruce barker" wrote:
this can not really be done. controls can not be reused between pages as few
if any are written to support running the page cycle twice. this is why
asp.net caches the output rather than the control.

you could parse it once, and use the control tree as a template. make copies
of each control and add to page. you would have to write a clone routine for
each control you use.

or you coudl switch to using LoadControl. which build a class file on the
first call, and resues it, so parses are no longer necessary.

-- bruce (sqlwork.com)
"JT-ARL" wrote:
I have a pretty tricky problem. I have a dynamically built page. I use
Page.ParseControls to parse the "entire page" (ASPX file contains only a Page
tag). ParseControls is pretty resource intensive so I would like to cache
the Page.Controls collection and reuse it on postback instead of issuing
page.parsecontrols on the source again. When I cache the Controls collection
and add the controls back to the page, the Page.Form property is null (I
don't exactly know why but there does not appear to be a way to initialize
it). I have been unable to find a solutions to this and any approaches
would be helpful. There is a form control in the controls collection but
again it is not registered with the page.
Thanks,
Justin
Oct 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: krs | last post by:
I am using XML/XSL to build a dynamic asp.net control at runtime. So the result of the XML/XSL transformation may result in a string such as: <asp:TextBox id="TextBox1" runat="server">...
0
by: Martin | last post by:
Hi. I had a very frustrating afternoon and evening but I have got it all under control now so all of a sudden I am in a good mood. I want to share some insights on output caching with you lot. ...
2
by: Dave Williamson | last post by:
When a ASPX page is created with dynamic controls based on what the user is doing the programmer must recreate the dynamic controls again on PostBack in the Page_Load so that it's events are wired...
2
by: vikram | last post by:
I have to design a page which contains a dynamic generated menu at left side.Menu will be generated once a user log in and will remain as it is for the rest of the user session. Problem is that...
0
by: Neal Terrell | last post by:
I'm having a world of trouble wrestling with ASP.NET's caching system. I have an ASPX page that produces a JPG image on the Response output stream, and this image is embedded in another page. The...
5
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
28
by: Peter Michaux | last post by:
Hi, I'm playing with dynamic script insertion to make a request to the server for a JavaScript file to be automatically run when it arrives in the browser. It works but... The page caching...
14
by: Gilles Ganault | last post by:
Hi One of the ways to raise performance for PHP apps is to separate static contents from dynamic contents, so that the former can be compiled once into cache. Can someone give me a simple...
14
by: asdf | last post by:
I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.