Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Fel vid listning av sidtyper

Vote:
 
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?
#12272
Apr 29, 2005 14:53
Vote:
 
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"; }
#13952
Apr 29, 2005 15:58
Vote:
 
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.
#13953
May 02, 2005 9:26
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.