CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > starter_kits_and_source_projects.dotnetnuke.resources Tags:
Item Type: Date Entered: 5/24/2006 11:56:44 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 87 Favorited: 0 Favorite
1 Items, 1 Pages 1 |< << Go >> >|
"dehaggard" <>
NewsGroup User
Improve 4.x performance -- Server-side ViewState5/24/2006 11:56:44 PM

0

Here is a great way to help DNN 4.x performance for pages that have many modules, modules with many ViewState-hungry controls, and for sites with dial-up users.

I have been building a pair of modules for a company I'm consulting with. One of their requirements was to replace their old site with a DNN site, and to put everything from their two applications onto only two DNN pages. Their old app required clicking from page to page to page to do even the simplest tasks.

So I used DNN 4.0.x (ASP.NET 2.0), and used the Multiview control in my two modules. Trouble is, these modules have a couple hundred controls on each page (text boxes, check boxes, grid views, dropdowns), so the ViewState got HUGE. So huge that even on a local Intranet the response time was horrible, due to transmission load and browser rendering time. Yes, I went through the usual steps of disabling ViewState on every control possible, without having to write major chunks of code to compensate.

I did some digging, and found that ASP.NET 2.0 has the ability to save the ViewState server-side, already built in. So I followed some examples I found and put together a solution. This solution reduces ViewState in the browser to bare minimum, no more than 3 short lines of text when you look at it from "View source." The result was a major improvement in performance. (Less than 1 second to load a page, whereas before it was over 10 seconds.)

The beauty of this, too, is that it requires NO alteration of DNN 4.x Core code, and nothing special in the modules.

You can download the code from my web site at--
http://www.newcovenant.com/Portals/0/PageStateAdapter.zip

The zip file contains both source code and compiled code. It is only 5 kb in size.

To run this on your DNN 4.x site:

Before installing, connect to a page on your site. Open "View source" on the page, scroll down to the bottom, and look at how big the ViewState hidden field value is.

  1. Unzip the file.
  2. Open the "Install\bin" folder.
  3. Copy DotNetNuke.PageStateAdapter.dll to your site's bin folder.
  4. In the root of your site, create a folder named App_Browsers. (This is one of those ASP.NET "special" folders.)
  5. Open the "Install\App_Browsers" folder from the unzipped zip file.
  6. Copy the PageStateAdapter.browser file into the new App_Browsers folder of your site.
  7. Open your web.config file in an editor.
  8. In the <appSettings>...</appSettings> block, add this optional* key:
    <add key="ServerSideViewState" value="true" />
  9. Save web.config back to your site.

That's it. Now connect a browser to the same page of your site. (Of course, since you altered web.config it will take a bit longer to open the first time.) Check "View source" on the page, and scroll down to the ViewState hidden field. You will see that it is significanly smaller.

You can test the installation by simply changing the value of the new web.config key from "true" to "false" and back again. Check the "View source" each time to see how the feature turns on and off.

*If the "ServerSideViewState" key does not exist in web.config, but you installed the .dll and the .browser files, the site will behave as normal. No error, and ViewState will be in the web page. If the key is not present in web.config, it's the same as being set to "false." The values "0" and "1" should work, too, since the code uses--
   Convert.ToBoolean(appSettings("ServerSideViewState"))


David Haggard


NewCovenant Consulting
1 Items, 1 Pages 1 |< << Go >> >|


Free Download:













asp.net server problem?

how to delay binding of attributes for a server control

image on the browser tab

data reader question.

classical asp / asp.net

how to reserve space for label?

how to run flash video with transparent background

button_click

upload all file in a folder / zip file handling

container user control with design time support

help require

hide options from some users

how to publish web site using visual studio .net

referencing variables

date format

how do i specify an email bounce address?

need to display a math calculation

multiple dropdownlists

sqldatasource + drop down list

need to find a really good user customizable reporting module

is there any framework for website building in asp, sql server??????/

how to hide webpage name from url in web browser address bar

possible to assign search results to variables (session variables)

what does orelse do?

news website

oops - reallife example / source code

authentication failure

gdi+ doubt

how to take 30 first caracters ???

using web matrix web server with visual studio .net 2003

instantiating a class from the app_code folder in a code-behind file

is there a control to allow a user to enter html?

browser targeting?

asp.net web app looks weird in firefox

new line in textbox

how do i use a asp calendar with a sql database?

discuss home of mumushu website

getting years to show

probleme with special characters

seperating business logic from presentation (using code behind)

accessing a binded value in a datalist.

asp.net 1.1 and validation

hyperlink control - navigateurl

set value at certain column in every row

help with function - converting a double num into a hh:mm:ss format

how to check dataset empty or not

file or assembly name microsoft.matrix.framework error

forcing a reload or postback from an asp button

stringwriterhtml, htmltextwriter <br> tag problem

post method question

   
  Privacy | Contact Us
All Times Are GMT