Hi,
I'm tring to use the usercontrol wrapper for my own custom datatype. I've started out with a little test that I can't get working! I wanted to emulate the 'Textstring' datatype. I'm using the following code..
Code:namespace ipr
{
public partial class myTextDataType : UserControl, umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor
{
public string umbracoValue;
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
umbracoValue = myBox123.Text;
}
else
{
myBox123.Text = umbracoValue;
}
}
#region IUsercontrolDataEditor Members
public object value
{
get
{
return umbracoValue;
}
set
{
umbracoValue = value.ToString();
}
}
#endregion
}
}
..and the following presentation code...
Code:<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="myTextDataType.ascx.cs" Inherits="ipr.myTextDataType" %>
<asp:TextBox ID="myBox123" runat="server"></asp:TextBox>
I create the datatype just fine and it renders fine. When I type in a value and save it however nothing gets persisted. I set a breakpoint in the page load and found that on postbacks nomatter what I've typed in the Textbox the myBox123.Text is empty which explains why nothing is getting saved. Bigger question is why I don't see anything in that property on the postback (I can still see my text in the rendered webpage after the postback which is very odd!)? Any ideas? Ta!