AI OnAI Off
<%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI" %>
By setting the attribute DisablePageLeaveCheck="true" the warning with postbacks will be disabled.
// M
private Label lblMessage; public override void CreateEditControls() { base.CreateEditControls(); lblMessage = new Label(); lblMessage.Font.Italic = true; Control.Controls.Add(new LiteralControl(" ")); Control.Controls.Add(lblMessage); Control.Controls.Add(new LiteralControl(" ")); Button btn = new Button(); btn.Click += new EventHandler(btn_Click); btn.Text = "Hit it!" Control.Controls.Add(btn); } void btn_Click(object sender, EventArgs e) { this.lblMessage.Text = "Something clicked"; }
If I change the value of a property of type PageReference, the change is lost after pressing my Button (value is set to previous value). If I try to edit an Integer property and then press my button, the "page not saved warning" pops up. Mari