Hi Guys,
I need help, I've been figuring this for a day but no luck.
Issue is I'm creating custom subscription registration form using CMS DataForm Controls.
With this controls I'm adding OnAfterSave event, but this event looks like never triggered even I put this in OnInit(), OnPreRender(), or in ReloadData().
Is there any something wrong?
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
formElem.OnAfterSave += BasicForm_OnAfterSave;
}
public override void ReloadData()
{
base.ReloadData();
SetupControl();
formElem.OnAfterSave += BasicForm_OnAfterSave;
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
formElem.OnAfterSave += BasicForm_OnAfterSave;
}
private void BasicForm_OnAfterSave(object sender, EventArgs e)
{
if (!Page.ClientScript.IsClientScriptBlockRegistered("showThanksMessageRegisterUpdate"))
{
var executeScript = new StringBuilder();
executeScript.AppendLine("$J(document).ready(function() {");
executeScript.AppendLine(string.Format("$J('#{0}').modal('hide');", ModalElementId));
executeScript.AppendLine(string.Format("$J('#{0}').modal('show');", ModalElementId));
executeScript.AppendLine(string.Format("$J('#{0}').animate({{height:\"200px\"}},400)", ModalElementId));
executeScript.Append("});");
Page.ClientScript.RegisterClientScriptBlock(GetType(), "showThanksMessageRegisterUpdate", executeScript.ToString(), true);
}
}