Want to add Checkbox List asp.net but not alignign correctly

Matt Lee 40 Reputation points
2024-10-10T12:57:33.08+00:00

I have a forms as described in this post

https://learn.microsoft.com/en-us/answers/questions/2086934/how-to-add-the-date-selected-to-an-asp-net-form-wi

the problem is I tried to add asp,net checkbox list but it does not style correctly. I have used Flow, Table layouts and need simple vertical repeat pattern with checkbox aligned left and text after. But the check box appears to the right and on the line below.

It could also be another input solution without using the control if that is more consistent..

thank you

Developer technologies ASP.NET Other
{count} votes

Accepted answer
  1. Lan Huang-MSFT 30,186 Reputation points Microsoft External Staff
    2024-10-11T03:09:02.8933333+00:00

    Hi @Matt Lee,

    It would be best if you can provide your code so that we can provide solution based on your code.

    Maybe you could try using a CheckBoxList control. For example:

    <asp:CheckBoxList ID="WeeklyCondition" runat="server">
        <asp:ListItem Value="1">Sat</asp:ListItem>
        <asp:ListItem Value="2">Sun</asp:ListItem>
        <asp:ListItem Value="3">Mon</asp:ListItem>
        <asp:ListItem Value="4">Tue</asp:ListItem>
        <asp:ListItem Value="5">Wed</asp:ListItem>
        <asp:ListItem Value="6">Thu</asp:ListItem>
        <asp:ListItem Value="7">Fri</asp:ListItem>
    </asp:CheckBoxList>
    

    User's image

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Helen Handson 0 Reputation points
    2024-10-10T17:13:24.47+00:00

    You can resolve the checkbox alignment issue by using CSS. Set the container to display: block and style the checkbox with proper margins to align it to the left of the text. This will ensure a clean vertical layout without relying on ASP.NET layout controls. Milky Way Online Game Download

    0 comments No comments

  2. Matt Lee 40 Reputation points
    2024-10-15T11:17:28.19+00:00

    I belive it was the CSS bootstrap template causing the problem and now I added 3 x single checkboxes and check the value from each instead of using the list.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.