Hej jag skulle vilja göra en Checkboxlista liknande den som visas i Exportsidan i Admin. Jag har försökt att skapa en helt vanlig asp:CheckBoxList och poluerar den men får ständigt samma felmeddelande i stackstårningen.
Undantagsinformation: System.ApplicationException: Too short key: "0", must be at least four characters.
[ApplicationException: Too short key: "0", must be at least four characters.]
EPiServer.ApplicationConfiguration.ᐁ(String ) +207
EPiServer.ApplicationConfiguration.get_Item(String key) +4
EPiServer.Admin.Settings.SetControlValues(ControlCollection controls) +791
EPiServer.Admin.Settings.SetControlValues(ControlCollection controls) +110
EPiServer.Admin.Settings.SetControlValues(ControlCollection controls) +110
EPiServer.Admin.Settings.SetControlValues(ControlCollection controls) +110
EPiServer.Admin.Settings.SetControlValues(ControlCollection controls) +110
EPiServer.Admin.Settings.SetControlValues(ControlCollection controls) +110
EPiServer.Admin.Settings.Page_Load(Object sender, EventArgs e) +297
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +739
Koden ser ut så här
.aspx
protected CheckBoxList PageTypeList;
.
.
.
GetPageTypeList()
.
.
.
protected void GetPageTypeList()
{
PageTypeCollection pageTypes = new PageTypeCollection();
pageTypes = PageType.List();
PageTypeList.DataSource = pageTypes;
for(int i=0; i
Vad/var gör jag fel?
Har ikke testet dette, men du bruker databinding feil. DataTextField og DataValueField er navnene på feltene du skal ha ut.
protected void GetPageTypeList()
{
PageTypeCollection pageTypes = new PageTypeCollection();
pageTypes = PageType.List();
PageTypeList.DataSource = pageTypes;
PageTypeList.DataTextField = "Name";
PageTypeList.DataValueField = "Id";
}
I've allready tryed that and I get the same error message. I'm beggining to wonder if EP in Admin mode is mapping this type of components and requires some special initiation.
protected CheckBoxList PageTypeList; . . . GetPageTypeList() . . . protected void GetPageTypeList() { PageTypeCollection pageTypes = new PageTypeCollection(); pageTypes = PageType.List(); PageTypeList.DataSource = pageTypes; for(int i=0; i
Vad/var gör jag fel?