I am in the process of creating a custom data type which allows the user to select multiple items from a list box which is stored as a comma delimited list when saved. The bulk of the work is done with Javascript which saves the Node Id's into a hidden input. The hidden input will then be stored as the value.
It's still in development so at the moment I only have the .ascx file running, the .ascx.cs isn't doing anything except returning a blank value and populating one of the list boxes. My problem is that when I click save and publish it grinds to a halt, taking ages then eventually causes a 503 error. Document Types not using this Data Type save normally and quickly.
As the .ascx file is rendering ok I assumed the problem is something to do with the .cs (code below). I am running Umbraco 4.5 on .Net 3.5 and using the UmbracoTv.DataEditors.UCWrap to create the data type.
namespace UmbracoTv.DataEditors.UCWrap { public partial class MulitSelect : System.Web.UI.UserControl, umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Node performers; performers = new umbraco.presentation.nodeFactory.Node(1075);
not sure if this is relevant anymore or you figured it out already. Haven't encountered anything like that yet. However it might be because the value never gets initialized or set properly. Here is the code of a custom datatype I have implemented on a recent project:
private string umbracoValue;
public object value { get { return umbracoValue; } set { umbracoValue = value.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["filmFile"] = umbracoValue; //comment this out, not needed just to get it work
SetFlowPlayerVideo(); //comment this out } else { umbracoValue = Session["filmFile"].ToString(); //populate with something else, e.g. 'test', just so that it has a value. }
Thank you very much for your help on this. This has stopped it crashing and given me something to start building on, which is fantastic. Thanks for your help. Sorry for taking so long to get back to you.
Custom Data Type crashing on save and publish
Hi there
I am in the process of creating a custom data type which allows the user to select multiple items from a list box which is stored as a comma delimited list when saved. The bulk of the work is done with Javascript which saves the Node Id's into a hidden input. The hidden input will then be stored as the value.
It's still in development so at the moment I only have the .ascx file running, the .ascx.cs isn't doing anything except returning a blank value and populating one of the list boxes. My problem is that when I click save and publish it grinds to a halt, taking ages then eventually causes a 503 error. Document Types not using this Data Type save normally and quickly.
As the .ascx file is rendering ok I assumed the problem is something to do with the .cs (code below). I am running Umbraco 4.5 on .Net 3.5 and using the UmbracoTv.DataEditors.UCWrap to create the data type.
namespace UmbracoTv.DataEditors.UCWrap
{
public partial class MulitSelect : System.Web.UI.UserControl,
umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Node performers;
performers = new umbraco.presentation.nodeFactory.Node(1075);
foreach (Node performer in performers.Children)
{
list_all_performers.Items.Add(new ListItem(performer.Name.ToString(), performer.Id.ToString()));
}
}
lit_list_all_performers.Text = list_all_performers.ClientID.ToString();
lit_list_for_new_performers.Text = list_new_performers.ClientID.ToString();
lit_artists.Text = testText.ClientID.ToString();
}
#region IUsercontrolDataEditor Members
public object value
{
get
{
return value;
}
set
{
}
}
#endregion
}
}
Has anyone else experienced a problem with custom data types causing this sort of slow down? any help would be greatly appreciated.
Gary Stevens
Hi Gary,
not sure if this is relevant anymore or you figured it out already. Haven't encountered anything like that yet. However it might be because the value never gets initialized or set properly. Here is the code of a custom datatype I have implemented on a recent project:
Hope that helps,
Sascha
Hi Sascha
Thank you very much for your help on this. This has stopped it crashing and given me something to start building on, which is fantastic. Thanks for your help. Sorry for taking so long to get back to you.
Many thanks
Gary Stevens
Great stuff, glad I could be of help. :)
is working on a reply...