-1

I've just started using Visual Studio 2012 Express WEB and am having a lot of issues with some of the controls I am creating in code-behind.

For example, for my RadiobuttonList, the actual radio button sits inside this white text-box-like background and it very long, and the text sits below the radio button:

enter image description here

My codes are as below:

RadioButtonList radioOption = new RadioButtonList();
                    SqlCommand command1 = new SqlCommand(cmd, conn);
                    SqlDataAdapter adapter1 = new SqlDataAdapter(command1);
                    adapter1.Fill(dt1);

                    if (dt1.Rows.Count > 0)
                    {
                        for (int i = 0; i < dt1.Rows.Count; i++)
                        {
                            radioOption.Items.Add(new ListItem(dt1.Rows[i][9].ToString(), dt1.Rows[i][8].ToString()));
                        }
                    }
                    tb.Rows.Add(tr);
                    td2.Controls.Add(radioOption);
                    tr.Cells.Add(td2);

Any ideas? I'm using the master page template for VS Express.

Also, what CSS code can I use to fix this design problem? Many thanks.

viv_acious
  • 2,429
  • 9
  • 34
  • 55

1 Answers1

0

found my solution here:

http://forums.asp.net/t/1876579.aspx/2/10?Weird+Radio+button+appearance+in+Visual+Web+Express+2012

label.checkbox {
    display: inline;
}

input, textarea {
    border: 1px solid #e2e2e2;
    background: #fff;
    color: #333;
    font-size: 1.2em;
    margin: 5px 0 6px 0;
    padding: 5px;
    width: 20px;
}
viv_acious
  • 2,429
  • 9
  • 34
  • 55
  • I ran into this exact same issue just today. I cannot believe this shipped and has still not been fixed. Having to add custom CSS to get a standard control to work, in the IDE's own default solution template, is just insane. – paparush Nov 01 '14 at 01:18