I've created a custom usercontrol so that members can edit there information in the front-end.
I have a few issues though. When saving the fields, I get an error saying
[NullReferenceException: Object reference not set to an instance of an object.] umbraco.editorControls.BaseTreePickerEditor.Save() +65 Kmostarter_MemberCtrls.usercontrols.EditProfiel.UpdateMember_Click(Object sender, EventArgs e) +653 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +153 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3690
When looping through all the properties of the logged in member I translate each umbraco datatype to a webcontrol like:
Control propertyfield = df.DataEditor.Editor; switch (propertyfield.ToString()) { case "umbraco.editorControls.textfield.TextFieldEditor": TextBox txtbox = new TextBox(); txtbox.ID = df.DataEditor.Editor.ID; txtbox.Text = df.Data.Value.ToString(); txtbox.CssClass = "kol-30"; editControls.Controls.Add(txtbox); lbField.AssociatedControlID = df.DataEditor.Editor.ID; break; ... }
The problem is that I have a few custom dropdowns in the membertype which is used,
with predefined values. But I don't know how to translate this Umbraco
datatype in a proper webcontrol. And how to translate a tinymce editor into a multiline textfield.
Editing members using a usercontrol
I've created a custom usercontrol so that members can edit there information in the front-end.
I have a few issues though. When saving the fields, I get an error saying
Is there any information on how to build a proper usercontrol like this page with example code?:
http://umbraco.org/profile/edit-your-details
When looping through all the properties of the logged in member I translate each umbraco datatype to a webcontrol like:
Control propertyfield = df.DataEditor.Editor;
switch (propertyfield.ToString())
{
case "umbraco.editorControls.textfield.TextFieldEditor":
TextBox txtbox = new TextBox();
txtbox.ID = df.DataEditor.Editor.ID;
txtbox.Text = df.Data.Value.ToString();
txtbox.CssClass = "kol-30";
editControls.Controls.Add(txtbox);
lbField.AssociatedControlID = df.DataEditor.Editor.ID;
break;
...
}
The problem is that I have a few custom dropdowns in the membertype which is used, with predefined values. But I don't know how to translate this Umbraco datatype in a proper webcontrol. And how to translate a tinymce editor into a multiline textfield.
Thanks in advance.
grts,
Kim
Kim take a look at the source of doc2form it will give you some hints http://our.umbraco.org/projects/website-utilities/doc2form
Regards
Ismail
is working on a reply...