MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Getting started with WAO - Web Application Optimizer  (Mono Support )

Viewed 9399 time(s), 2 post(s) 2/16/2012 4:45:38 PMby gmtorres
gmtorres

gmtorres

2/16/2012 4:45:38 PM
Hi,

I'm having trouble getting WAO up and running in a way that proves to me that it is working correctly. Though you have many downloads for usage, the example projects don't seem to let me discover whether my simple test is working or not.

I simply want to get a sample running where I can see the viewstate be compressed, much lke the functionality on your website. I'm loading the ViewState with a long string and checking source. It seems to be the same at this point as a regular project sans WAO. I'll need help with web config settings it looks like.

I'm only trying to do this on cassini of vs2010 for now. My understanding is that's IIS7 in classic mode.
This content has not been rated yet. 
15 Reputation 1 Total posts
khorvat

khorvat

2/17/2012 7:33:37 AM
Hi,

can you tell us what provider do you use as the default one ? Did you perform the following actions while implementing WAO

1. Register WAO SectionGroup in your web.config:
<sectionGroup name="MonoSoftware.Web.WAO">
...
    <section name="ViewState" type="MonoSoftware.Web.WAO.ViewState.Configuration.ViewStateConfiguration, MonoSoftware.Web.WAO"/>
...
</sectionGroup>

2. Register WAO Section in your web.config, and configure the ViewState optimizer. 
<MonoSoftware.Web.WAO>
    ...
    <ViewState turnedOn="true" defaultProvider="CompressionProvider">
      <providers>
        <clear />
        <add workingFolder="" sqlConnectionString="Data Source=;uid=;pwd=;database=;"
          name="SqlProvider" type="MonoSoftware.Web.WAO.ViewState.Providers.SqlProvider, MonoSoftware.Web.WAO"
          customProperties="RecycleTime=60;ViewStateTimeout=480;" />
        <add workingFolder="" sqlConnectionString="" name="CompressionProvider"
          type="MonoSoftware.Web.WAO.ViewState.Providers.CompressionProvider, MonoSoftware.Web.WAO"
          customProperties="" />
        <add workingFolder="" sqlConnectionString="" name="CacheProvider"
          type="MonoSoftware.Web.WAO.ViewState.CacheProvider, MonoSoftware.Web.WAO"
          customProperties="ViewStateTimeout=120;" />
        <add workingFolder="/Cache" sqlConnectionString="" name="DiskProvider"
          type="MonoSoftware.Web.WAO.ViewState.Providers.DiskProvider, MonoSoftware.Web.WAO"
          customProperties="RecycleTime=60;ViewStateTimeout=480;" />
      </providers>
    </ViewState>
    ...
</MonoSoftware.Web.WAO>

3. Override the PageStatePersister property on System.Web.UI.Page class as displayed below:
private PageStatePersister _pageStatePersister = null;
/// <summary>
/// Page state presister.
/// </summary>
protected override PageStatePersister PageStatePersister
{
    get
    {
            try
            {
                if (_pageStatePersister == null)
                    _pageStatePersister = ViewStateConfiguration.GetPageStatePersister(this.Page);
                return _pageStatePersister;
            }
            catch (Exception ex)
            {
                //log.Error(ex);                       
            }
 
        if (_pageStatePersister == null)
        {
            if (base.PageStatePersister == null)
                _pageStatePersister = new HiddenFieldPageStatePersister(this);
            else
                _pageStatePersister = base.PageStatePersister;
        }
        return _pageStatePersister;
    }
}


If you perform the tasks above please provide us with the web.config (you can send it by an InMail - top, right Messages link), and HTML source of one of the pages that enables the WAO ViewState optimization.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts