Showing posts with label tabcontainer. Show all posts
Showing posts with label tabcontainer. Show all posts

Monday, March 26, 2012

Printing TabContainer

Hi there!

Just wondering if anyone has managed to achieve the following:

I've got a page with a TabContainer in it... and I want to print it. By default the printed page will show the tab container just as it appears on screen.
But that's not what I want!!
I want to the printed page to reflect the contents of the TabContainer e.g.

Tab1

Tab1's contents get rendered

Tab2

Tab2's contents get rendered

etc. etc.

I've had a brief look at how to accomplish this, but am realising this is probably going to take a fair bit of time and effort to do. So I was wondering if anyone had "done the work for me" and I could crib a solution together!!!

Now I suppose you want to know why I want to do this... well basically I'm going to have 100's of pages containing tabs that my users can view. Despite the information being available on screen they love to print anything and everything off for their own records. I really don't want to end up 2 versions of every page... 1 for on screen display... and one made nice and pretty for printing purposes!!

My current thoughts are:

    Write an extender to hook into the beforeprint and afterprint events on the client to "pretty" everything up.

    Write some @dotnet.itags.org.media print and @dotnet.itags.org.media screen to maybe deal with the changes

    Probably my favourite option... write a control adapter for the TabContainer... this could look at a querystring parameter to determine if I am trying to render a printable version or not. If not, render as normal, otherwise change the output so that each TabPanel is visible and lined up vertically one after the other.

Any ideas/thoughts??

Cheers,

James

Hmmm... been thinking about this a fair bit more since I posted... I'm now convinced that the ControlAdapter route is the best.

I'm playing round with a solution that seems to work quite well (and thankfully took a lot less time than I originally anticipated).
Still got a few things to sort out though to make it look "right"!


[Ignore]


[Sorry ignore again]

Wednesday, March 21, 2012

Problem in Speeding Up First Load of this page...

Improving Response Loading

Hi,

Is there a guide in improving loading performance when using atlsa controls liek update panel, tabcontainer and tabpanels, multiview and view, Gridview, composite controls, web user controls, updateprogress and other asp.net web controls together in a web user control. I have this user control that contains 2 tabcontainers, first, has 3 tabpanels, second,
is contain as child tabpanel of one of outer tabpanels, has 6 tab panels, currently 3 of these tab panels has usercontrols, 2 outer tabpanels has gridview in them.

Is there a way to speed up loading for first time? Any ideas, I time first load of this page, it time between 4 to 6 seconds, sometimes even 9 seconds.

Basically AddButtonAttribute(), GetPostBackAugument(), GetGlobalParameter(), PopulateFilterDropDown(), PopulateFilterDropDown(), and RestrictTabs() and base.OnLoad(e) are executed when this page is loaded for first time.

protected override void OnLoad(EventArgs e) { AddButtonAttribute();//Add Attribute javascript functionstring args = GetPostBackArgument();//Get _PostBack(control, argument)string tabPage = GetGlobalParameter();//Get a global hidden field valueif (!Page.IsPostback) {if (tabPage !=string.Empty && args !="Redirect") RedirectTabPage(viewPage);//Where a TabPanel speciifc function is handled including loading usercontrol to this usercontrol }else {if (tabPage !=string.Empty && args !="Redirect") RedirectTabPage(tabPage);//Where a TabPanel speciifc function is handled including loading usercontrol to this usercontrolelse if (args =="ContentRedirect") PopulateFilterDropDown();//Populate 3 Dropdownlist controls } RestrictTabs();//Restrict Tabpanelsbase.OnLoad(e); }

Structure like this xml:

4 usercontrols

<hiddenfields = 14>
<UpdatePanel>
<TabContainer>
<TabPanel>
<MultiView>
<View>
<UpdateProgress></UpdateProgress>
<control></control>
<GridView></GridView>
<control></control>
</View>
<View>
<Table>
<control>
</control>
<control>
</control>
</Table>
</View>
</MultiView>
</TabPanel>
<TabPanel>
<MultiView>
<View>
<UpdateProgress></UpdateProgress>
<control></control>
<GridView></GridView>
<control></control>
</View>
<View>
<Table>
<control>
</control>
<control>
</control>
</Table>
</View>
</MultiView>
</TabPanel>
<TabPanel>
<TabContainer>
<TabPanel>
<Table>
<control>
</control>
<control>
</control>
</Table>
</TabPanel>
<TabPanel>
<Table>
<control>
</control>
<control>
</control>
</Table>
</TabPanel>
<TabPanel>
<Table>
<control>
</control>
<control>
</control>
</Table>
</TabPanel>
<TabPanel>
<UserControl></UserControl>
</TabPanel>
<TabPanel>
<UserControl></UserControl>
</TabPanel>
<TabPanel>
<UserControl></UserControl>
</TabPanel>
</TabContainer>
</TabPanel>

</TabContainer>
</UpdatePanel>

Thabks in advanced.

I was wondering using Session to replace HiddenFields to speed up loading, and put controls found inside tab into a user control and loading them when it is needed, will this speed up loading process a lot?

Try this set

<% @.Page Trace="True" %>The trace information will show you exactly how large your ViewState is for that page.

try to figure out which controls you can disable the ViewState for (EnableViewState="False") or what might be causing your ViewState bloat.

Check debug="false" is et or not in web.config, it will improve some performance