Get Started!

Support EDIT mode

How to create a control that supports EDIT mode & Data Sources

Simple Example

Here's a basic example for editing a field :

Code Behind

protected override void initialize()
{
  base.initialize();

  loadDataItem();

  // Here oDataItem is loaded with the Doc from the DB
  hValue.Value = oDataItem.cMainTitle;

}

protected override void initialize_SAVE()
{
  base.initialize_SAVE();

  // Fix the control's value
  FixHiddenControl(hValue);

  oDataItem.cMainTitle = hValue.Value;

}

HTML / ASCX

<h1 data-mercury="simple"><%=oDataItem.cMainTitle%></h1>

<asp:hiddenfield runat="server"
                 id="hValue"
                 clientidmode="autoid">
</asp:hiddenfield>

Extended options