User Control Caching

Posted by Community Admin on 03-Aug-2018 15:12

User Control Caching

All Replies

Posted by Community Admin on 20-Oct-2010 00:00

Hello.
I'm having trouble getting my user controls to work on the Sitefinity 4 Beta-2 installation when I
add a <%@ OutputCache Duration="3600" VaryByParam="none" %> directive.
The error message is:
Exception Details: System.Reflection.TargetException: Object does not match target type.

The caching works fine outside Sitefinity, and if I don't create any public variables for the control all looks fine too.
Any ideas?
Thanks
Torbjorn

--------------------------------------------------
MyUserControl.ascx:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyUserControl.ascx.cs"
    Inherits="CustomControls_MyUserControl" Debug="True" %>
<%@ OutputCache Duration="3600" VaryByParam="none" %>

<div>
    This is the User Control text.<hr />
    First Name:
    <asp:Label ID="lblFirstName" runat="server" Font-Bold="true"></asp:Label><br />
</div>

MyUserControl.ascx.cs:

 

using

 

System;

 

 

 

using

 

System.Collections.Generic;

 

 

 

using

 

System.Linq;

 

 

 

using

 

System.Web;

 

 

 

using

 

System.Web.UI;

 

 

 

using

 

System.Web.UI.WebControls;

 

 

 

public

 

partial class CustomControls_MyUserControl : System.Web.UI.UserControl

 

 

  public string m_FirstName = string.Empty;

 

 

  private string m_LastName = string.Empty;

 

 

  private int m_Age = 0;

 

 

 

  # region

 

Properties

 

 

  public string FirstName

 

  

 

    get return m_FirstName;

 

 

    set m_FirstName = value;

 

  

 

 

  #endregion

 

Properties

 

 

  protected void Page_Load(object sender, EventArgs e)

 

 

    lblFirstName.Text = m_FirstName;

 

 


Posted by Community Admin on 22-Oct-2010 00:00

Hi Torbjorn,

Thank you for using our services.

Unfortunately caching is not yet supported in Sitefinity 4.0, We plan on having support for caching for the official resale of Sitefinity.

Kind regards,
Radoslav Georgiev
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

This thread is closed