change property on user control
<p>I changed a public property in my web user control but the client doesn't see that change until I delete the user control and re-add it and then it sees the change.</p>

<p>I'm thinking to myself what if the user control is used in many places, will I have to do that to all of the pages? Certainly, I missing something?</p>

<p>Here's the code-behind of my webusercontrol:</p>

<pre><code>public partial class ReportExporter : System.Web.UI.UserControl
{
    public IEnumerable&lt;object&gt; DataSource { get; set; }

    public String ExportFilename { get; set; }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void BtnExportCsv_Click(object sender, EventArgs e)
    {
        //Client needs to subscribe to this event and set the
        //DataSource property with IEnumerable. 
        //Todo: Find other ways to show this as a requirement.
        OnExportEvent(e);
        if (String.IsNullOrEmpty(ExportFilename))
            ExportFilename = "NeedToOverrideThisName";
        Response.Clear();
        Response.ContentType = "text/csv";
        Response.AddHeader("Content-Disposition", "attachment; filename=" + ExportFilename + ".csv");

        byte[] csvData = Utility.ToCsv(",", DataSource.ToList());
        Response.OutputStream.Write(csvData, 0, csvData.Length);
        HttpContext.Current.Response.End();
    }

    protected void BtnExportPdf_Click(object sender, EventArgs e)
    {

    }

    public event EventHandler ExportEvent;

    protected void OnExportEvent(EventArgs e)
    {
        if (ExportEvent != null)
        {
            ExportEvent(this, e);
        }
    }

}
</code></pre>

<p>All I did was change the property name for DataSource, it was AnyList.</p>
