locked
label widths were not rendering to the browser RRS feed

  • Question

  • Hi, I am working on a web application that dynamically loads controls based on user preferences. The Labels and Textboxes are being loaded at run time. When my boss deployed it to a new webserver the label widths were not rendering to the browser but, it works fine for me running it from Visual Studio 2010. We are both using IE10. The web server is a Windows 2008 R2 running IIS7.5. Here is how I create the control:

                                    cell = new HtmlTableCell();

                                Label label = new Label();

                                label.Text = props.LabelText;

                                label.Width = 150;

                                cell.Controls.Add(label);

    When I view the source code on my machine it looks like this:

           <td><span style="display:inline-block;width:120px;">Company:</span></td>

    Source code from the server looks like this:

           <td><span style="display:inline-block;">Company:</span></td>

    Width is dropped, has anyone come across this before?

    • Moved by Eason_H Thursday, October 31, 2013 7:58 AM
    Wednesday, October 30, 2013 8:07 PM

Answers

All replies

  • Hi jmclellan,

    Since the issue regards ASP.NET and website deployment. I suggestion you post the question in the ASP.NET forums at http://forums.asp.net/. It is appropriate and more experts will assist you.

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 31, 2013 7:58 AM
  • Something here seems wrong. In the code you give it a 150 value, but when it does render it gives you - 120.

    Double check your code.

     

    Noam B.



    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...

    • Proposed as answer by Noam B Thursday, October 31, 2013 11:23 AM
    Thursday, October 31, 2013 11:23 AM
  • Thanks, I will
    • Marked as answer by jmclellan Friday, November 1, 2013 2:44 PM
    Thursday, October 31, 2013 1:31 PM
  • It was the compatibility mode in IE10, once I turned it on for that site it worked.
    Friday, November 1, 2013 2:45 PM