CheckBoxList Won't Render As Unordered List

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/21/2010 8:38:25 PM
Gravatar
Total Posts 156

CheckBoxList Won't Render As Unordered List

I've added CheckBoxList to my custom module with the following mark-up:

<asp:CheckBoxList ID="lstAccounts" runat="server" RepeatLayout="UnorderedList"></asp:CheckBoxList>

 

I want it to be rendered as unordered list, but whenever I compile and run, I always get a table.  Any ideas as to what might be wrong here? I'm using a default skin at the moment.

7/23/2010 8:33:22 AM
Gravatar
Total Posts 18439

Re: CheckBoxList Won't Render As Unordered List

Hi,

You should lookup the documentation for ASP.NET controls on msdn then you can find what are allowed values for various settings.

RepeatLayout only supports the setting values "Table" and "Flow", not "UnorderedList"

Hope it helps,

Joe

7/23/2010 10:40:44 AM
Gravatar
Total Posts 156

Re: CheckBoxList Won't Render As Unordered List

Well that is just very bizzare because I didn't write that code manually - VS2010 produced it. (http://fwd4.me/YD6)
 

7/23/2010 10:49:13 AM
Gravatar
Total Posts 18439

Re: CheckBoxList Won't Render As Unordered List

Oh, my bad, there are some new options in .NET 4

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeatlayout.aspx

Not sure why it is not working for you. Are you working in .NET 4 or 3.5?

 

7/23/2010 12:09:47 PM
Gravatar
Total Posts 156

Re: CheckBoxList Won't Render As Unordered List

Well, my custom projects are all in v4, but your projects appear to be all over the place :), which I can see why I guess.  The Data layer projects are at v2.0, the rest of them are set to target 3.5, but I've changed all of them to target v4.

7/23/2010 12:20:18 PM
Gravatar
Total Posts 18439

Re: CheckBoxList Won't Render As Unordered List

Changing project types on the mojoPortal projects is a bad idea that will make it hard for you to get updates. I recommend revert that. The main web ui projects already are configured for .NET 4 and you can make your own projects target .NET 4, but changing the other mojo projects is just shooting yourself in the foot.

If you are using .NET 4 and the control is not rendering correctly, make sure you have this on the <pages element in Web.config (as does the default mojoportal Web.config)

controlRenderingCompatibilityVersion="4.0"

if that is missing or set to something else then the controls may not render in 4.0 mode.

7/23/2010 12:33:36 PM
Gravatar
Total Posts 156

Re: CheckBoxList Won't Render As Unordered List

Reverted.  Looks like I had the target set to 3.5 on my custom Web.UI project.  Everything renders properly now.  Thank you, Joe :)

7/24/2012 5:37:52 AM
Gravatar
Total Posts 4

Re: CheckBoxList Won't Render As Unordered List

I got the same problem today. Also I solved it. Thank you very much, Joesmiley

7/24/2012 9:54:36 PM
Gravatar
Total Posts 4

Re: CheckBoxList Won't Render As Unordered List

oh, my god. It didn't work correctly. When I set "UnorderedList" to the CheckBoxList in a new project it works. But in mojoportal , I get table also. I had set the controlRenderingCompatibilityVersion="4.0". It didn't make sense. How can I do?

7/25/2012 7:44:50 AM
Gravatar
Total Posts 18439

Re: CheckBoxList Won't Render As Unordered List

Look in the theme.skin file in your skin folder, it has an entry like this:

<asp:CheckBoxList  runat="server"
    CssClass="aspcheckboxlist"
    RepeatColumns="2"
    RepeatDirection="horizontal"
    RepeatLayout="Table"

    />

you can either change it there or put a SkinID="whatever" on your control so that it won't inherit this from the current setting in theme.skin

Note that putting UnorderedList there will cause an error under .NET 3.5, I would change that in the skins we ship except we still support .NET 3.5 and that would cause an error  for those users, since the same skins are used in the mojoPortal packages for  .NET 3.5

Hope that helps,

Joe

7/28/2012 2:19:16 AM
Gravatar
Total Posts 4

Re: CheckBoxList Won't Render As Unordered List

haha,I've written my own SiteCheckBoxList control to Render UnorderedList. Anyway, thank you very much Joe.
You must sign in to post in the forums. This thread is closed to new posts.