Hi All, this is a well-coverd topic and super basic, but I am missing something. I have this custom data type using the userControlGrapper as base. I have done this before a million times over, but for some reason it's not saving the value from my control to the db/cache?
public partial class Dt_DocumentCategories : System.Web.UI.UserControl, IUsercontrolDataEditor
{
public string umbracoValue = "";
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("/App_Data/DocumentCategories.xml"));
if (!Page.IsPostBack)
{
_documentCategories.Items.Add(new ListItem("Select...", ""));
foreach (XmlNode nd in doc.DocumentElement.SelectNodes("//categories/add"))
{
_documentCategories.Items.Add(new ListItem(nd.Attributes["name"].Value, nd.Attributes["name"].Value));
}
}
if (!umbracoValue.Equals(""))
{
_documentCategories.Items.FindByValue(umbracoValue).Selected = true;
}
}
#region IUsercontrolDataEditor Members
object IUsercontrolDataEditor.value
{
get
{
return umbracoValue;
}
set
{
if (value != null && !String.IsNullOrEmpty(value.ToString()))
{
umbracoValue = value.ToString();
}
}
}
#endregion
I am running 4.5.1 on Win 7/SQL Server 2005. Is this related to 4.5.1, perhaps?
IUsercontrolDataEditor - Not Saving value
Hi All, this is a well-coverd topic and super basic, but I am missing something. I have this custom data type using the userControlGrapper as base. I have done this before a million times over, but for some reason it's not saving the value from my control to the db/cache?
I am running 4.5.1 on Win 7/SQL Server 2005. Is this related to 4.5.1, perhaps?
Thanks for helping - a seemingly - blind man!
-- Nik
Like I said, I'm blind...it helps to actually set the umbracoValue to something :) Sorry about the post...
-- Nik
is working on a reply...