Hi, I'm currently trying to build a web page to control the Permissions for part of extension to Sitefinity, however I'm running into some issues with the PermissionSet web control. I currently have an aspx page with the control on it and the following code to initialize it.
|public void Page_Load(object sender, EventArgs e) |
| PermissionSet1.Item = new ItemPermissions(); |
Saving the permissions works, however it crashes on Save with "Cannot have multiple items selected in a DropDownList". I can fix this with a rather nasty hack,
|public void Page_PreRender(object sender, EventArgs e) |
| DropDownList rolesList = PermissionSet1.Controls.FindControl("rolesList") as DropDownList; |
| rolesList.SelectedIndex = rolesList.SelectedIndex; |
but now I have the list being repopulated with the list of roles twice, and each post back caused the list to be populated again and again. It seems that the this control has never been tested directly on a aspx page directly and only the lifecycle of template and containers hides this.