DotNetNuke MVP Module Development: Tip #2 Disable AutoDataBind

In DotNetNuke MVP Module Development: Tip #1 The AutoDataBind Property I suggested to use AutoDatBind to automatically bind up the user control.  However, there are times when no binding should occur.  For example, when a Cancel button is clicked the view should not be bound.  AutoDataBind should be disabled when no model is need.

protected void cmdCancel_Click(object sender, EventArgs e)
{
    try
    {
        AutoDataBind = false;
        OnCancel();
    }
    catch (Exception exc)
    {
        Exceptions.ProcessModuleLoadException(this, exc);
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.