I have set up a widget for the backend of my Sitefinity site that has three textboxes and a button. The goal is to create a new column in the database:
protected void btnAddClick(object sender, EventArgs e)
Type TelerikType = Type.GetType(txtTelType.Text);
Type ColumnType = Type.GetType(txtColType.Text);
string error = "";
if (TelerikType == null)
error = "Telerik Type is invalid";
if (ColumnType == null)
error = "Column Type is invalid";
if (error.Length == 0)
error = "Added column successfully";
txtColType.Text = txtName.Text = txtTelType.Text = "";
literalErrorText.Text = string.Format(literalErrorText.Text, error);
I am having two problems:
When I enter Telerik.Sitefinity.Pages.Model.PageNode into the textbox, Type.GetType(txtTelType.Text) is returning null.
If I replace that portion with typeof(PageNode) I get "Specified type 'Telerik.Sitefinity.Pages.Model.PageNode' is not a dynamic type."
I'm hoping somebody might have some insight as to why these things wouldn't work correctly, or possibly a better way to approach this issue? For reference, my goal (at least for now) is to add a dynamic column that references PageNode so that I can specify a ShowInLeftNavigation boolean and a ShowInRightNavigation boolean. Thank you for any help you can provide.