LoadDefaultMetaField - Null reference exception
Hi,
I'm writing my custom control and my code fails when it attempts to retrieve a default meta field.
[TypeConverter(
typeof
(ExpandableObjectConverter))]
public
Telerik.Sitefinity.Metadata.Model.IMetaField MetaField
get
if
(
this
._metaField ==
null
)
this
._metaField =
this
.LoadDefaultMetaField();
this
._metaField.FieldName =
"NamedTextBox_"
+
this
.ClientID;
return
this
._metaField;
set
this
._metaField = value;
Hi Viktor,
Yes you are right LoadDefaultMetafield will persist the value of the form control into the database using database mapping attribute. I suppose you are getting an exception because of a missing using . I suggest adding using Telerik.Sitefinity.Model, using Telerik.Sitefinity.Modules.Forms.Web.UI.Fields. I suppose you have already added this as described here. If you are still getting the exception can you paste some code here to see the code used?
Greetings,
Stanislav Velikov
the Telerik team