User Control Caching
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;
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