locked
asp:Textbox size Pocket IE RRS feed

  • Question

  • User1929203955 posted

    I have what appears to be a very simple problem. I need to increase the font-size for a textbox on a form. The following works identically in IE7, but does not work in PocketIE. The problem is that asp.net is rendering different source code to the pocketIE browser than what I'm seeing in IE7 and I have no way of seeing what html code pocketIE is getting.

    ASPX
        <asp:TextBox runat="server" ID="foo" Font-Size="20px"></asp:TextBox>
        <input type="text" style="font-size:20px;" />

     IE7's output (If I put this code in another aspx page, everything from it renders fine on the pocketPC)
        <input name="ctl00$ContentPlaceHolder1$foo" type="text" id="ctl00_ContentPlaceHolder1_foo" style="font-size:20px;" />
        <input type="text" style="font-size:20px;" />


    Thanks


     

    Friday, June 1, 2007 9:09 AM

Answers

  • User1929203955 posted

    After trying a number of things I only found a single way to get this to work. I had to manually add the attribute to the textboxes via the OnDataBound method for my control. Below is a snippet of the code I use after recursively going through all the damn controls in the databound control. I hope this help someone out there. I also hope someone from Microsoft will respond and let me know if this is a bug or if I'm doing something wrong.

    1    if (C.GetType() == (Type)typeof(TextBox))
    2    { 
    3       ((TextBox)C).Attributes.Add("style", "font-size:22px;");
    4    }
    
     
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 21, 2007 10:48 AM