Solved

PostBack a User Control without postingback parent page

Posted on 2004-10-12
5
564 Views
Last Modified: 2012-06-27
I have a webpage that contains a very simple user control and an html based treeview contained within an ASP.net label control.   The treeview is very complex and takes a long time to render from ViewState upon loading the page after postback.   I want to update the simple user control which requires a roundtrip to the server.   This update should take less than a second but because it has to reload the treeview from viewstate it takes 3-4 seconds.  Is it possible to update the usercontrol without posting back the parent page.  I don't want to make any changes to the parent page outside of the user control.

Thanks
0
Comment
Question by:wibleb
  • 2
5 Comments
 
LVL 5

Expert Comment

by:ajitanand
ID: 12294914
if it is a simple html based tree view, can't you place its HTML in a javascript file, and store it externally? this way it wont get added to the viewstate and the page will load and process faster.

does this help?
0
 

Author Comment

by:wibleb
ID: 12297792
The Tree View is a heirarchy that is pulled from a database.  It is generated at run time on the initial page load.  I just know that it will not have changed when the User Control is updated.   What I have done now is disabled viewstate for the treeview and just recreate the html on each postback.  It requires a few more database hits but it is still faster than processing viewstate.   If I can't find a way to do a partial postback then this solution will work for me.
0
 
LVL 4

Accepted Solution

by:
vinhthuy_nguyen earned 125 total points
ID: 12321098
Just a small idea, why don't you use frame ?
<frameset rows="68,*,21" framespacing="0" border="0" frameborder="0">
      <frameset cols="*,81%">
      <frame name="contents" target="main" src="treeview_here.aspx" frameBorder="no" scrolling="no">
      <frame name="main" src="usercontrol_loadhere.aspx" target="_self">
      </frameset>
Have a nice weekend
0
 

Author Comment

by:wibleb
ID: 12534294
I think frames would be an ok solution.  What I actually did was disabled ViewState and recreated the tree on every postback.  It turned out that ViewState was so large and slow that rehitting the database was faster.  It is still not super fast but noticable improvement nonetheless.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

11 Experts available now in Live!

Get 1:1 Help Now