This is a migrated thread and some comments may be shown as answers.

RAD Compression - aspx page exception

1 Answer 58 Views
Compression
This is a migrated thread and some comments may be shown as answers.
Kishan Gandikota
Top achievements
Rank 1
Kishan Gandikota asked on 05 Aug 2010, 01:27 AM
Hi,

I am using view state compression specified in the below mentioned url. (App_Browsers changes)

http://www.telerik.com/help/aspnet-ajax/radcompression.html

<browsers>  
 
<browser refID="Default">   
   
<controlAdapters>  
     
<adapter controlType="System.Web.UI.Page" adapterType="Telerik.Web.UI.RadSessionPageStateCompression" />  
   
</controlAdapters>  
 
</browser>  
</browsers>

I have a aspx page which has "EnableSessionState = false" and "EnableViewState = false" set.

In this case, when i open the aspx, it is throwing the error "

SessionPageStatePersister can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive.

"

Please note that I have no code behind file for my aspx page... how do you give this in aspx page?
[RadCompressionSettings(HttpCompression = CompressionType.None)]  
Can I give this page as part of the exception list? Please help.

Regards,
Kishan G K

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 10 Aug 2010, 12:33 PM
Hello Kishan,

RadCompressionSettingsAttribute must be applied on class and as you are using single file model you cannot do that.

However you can inherit RadSessionPageStateCompression in order to overcome this scenario.

/class file that contains extend RadSessionPageStateCompression/
namespace CustomSpace
{
    public class CustomStateCompression : RadSessionPageStateCompression
    {
        public override System.Web.UI.PageStatePersister GetStatePersister()
        {          
            //if page session is disabled - used default bahavior
            if (HttpContext.Current.Session == null)
                return new HiddenFieldPageStatePersister(base.Page);
            //otherwise compress
            return base.GetStatePersister();
        }
  
    }
}

/browser file - utilize custom compressions adapter/
<browsers>
  <browser refID="Default">
    <controlAdapters>
      <adapter controlType="System.Web.UI.Page" adapterType="CustomSpace.CustomStateCompression" />
    </controlAdapters>
  </browser>
</browsers>


Regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Compression
Asked by
Kishan Gandikota
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or