Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Postback error

There is still complications when trying to make a post back in a property control. In my PropertyDataControlAdapter class I have the following code 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
Apr 20, 2007 9:29
The simplest way to avoid the "you're navigating away from this page..." dialog is to use the new EPiServer Control called Toolbutton: <%@ Register TagPrefix="EPiServerUI" Namespace="EPiServer.UI.WebControls" Assembly="EPiServer.UI" %> By setting the attribute DisablePageLeaveCheck="true" the warning with postbacks will be disabled. // M
Apr 20, 2007 16:02
This is a custom property type in edit mode?! The concept with EPi is that you don't use postback inside a property. Use client scripts to set values on the property, that is so that the editor have the possibility to cancel the update. If you need to do advanced things on a property, use a popup dialog. On that you are free to code with postbacks. When the dialog is closed update the property with new data to reflect the settings from the dialog. Then if the editor choose so, save the property value. I think there is some examples in Code Samples. Regards /HAXEN
Apr 23, 2007 9:19
Yes, in previous versions of EPiServer there were complications when trying to make a postback in a control. According to the Property Types documentation: With the new model in EPiServer CMS this should no longer be a problem. (Note that this part of the forum only includes posts about EPiServer CMS) Mari
Apr 23, 2007 9:57
Hi! It is indeed correct that you should be able to do post backs in your server control. We have a general problem with postbacks and some properties where disabled fields are showing old information after a postback if the page it not saved. This can appear if a property does a postback or if the save/publish generates validation errors. Note that this is only a visual glitch, the correct information is still updated through a hidden field. We have an issue for this that we are working on at the moment: 47011: Changes to some properties does not reflect the actual value after a postback. Regards Linus Ekström
Apr 26, 2007 17:16
Hi! I just wanted to inform you that this bug should be fixed in the RC2 that is planned later today so please feel free to test this.
May 31, 2007 9:43
Hello, I have final relase installed, and still get this message.
Oct 03, 2007 14:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.