Postback error

Vote:
 
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
#15660
Mar 25, 2008 18:58
Vote:
 
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
#16073
Mar 25, 2008 19:07
Vote:
 
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
#16074
Mar 25, 2008 19:07
Vote:
 
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
#16075
Mar 25, 2008 19:07
Vote:
 
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
#16076
Mar 25, 2008 19:07
Vote:
 
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.
#16077
Mar 25, 2008 19:07
Vote:
 
Hello, I have final relase installed, and still get this message.
#16078
Mar 25, 2008 19:07
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.