Multi-browser appearance problem

Discussion in 'ASP .Net' started by =?Utf-8?B?THVpcyBGYWphcmRv?=, Nov 5, 2004.

  1. I'm expiriencing a basic HTML appearance problem with ASP.NET. Following a
    couple of sample tags to ilustrate my problem:

    <asp:TextBox id="txtWidthIssue" runat="server" Width="100"></asp:TextBox>
    <asp:DropDownList id="ddlWidthIssue" runat="server"
    Width="100"></asp:DropDownList>

    Browser like Firefox and I'll imagine many others are not sizing correctly
    the controls (.net is removing the with property during the rendering). I
    tried to use STYLE="WIDTH: 100px" instead of the Width property, and is doing
    the resizing fine in Firefox, but, since STYLE is not natural to the server
    controls, every time I do something on the designer, .NET removes the STYLE.

    This is just a basic sample, I'm having all type of problems. I was under
    the impression that ASP.NET was going to render the appropriate HTML for the
    browser requesting the page, if that's right how should I use that
    functionality? That functionality includes my basic sample WIDTH?

    I'm seriously thinking to create a web custom controls layer to add some
    functionality to the basic controls, but before start on that, I'll like to
    know if there is a shortcut for this problem, using the current controls.


    Thanks in advance
    =?Utf-8?B?THVpcyBGYWphcmRv?=, Nov 5, 2004
    #1
    1. Advertising

  2. "Luis Fajardo" <> wrote in message
    news:...
    > I'm expiriencing a basic HTML appearance problem with ASP.NET. Following
    > a
    > couple of sample tags to ilustrate my problem:
    >
    > <asp:TextBox id="txtWidthIssue" runat="server" Width="100"></asp:TextBox>
    > <asp:DropDownList id="ddlWidthIssue" runat="server"
    > Width="100"></asp:DropDownList>
    >
    > Browser like Firefox and I'll imagine many others are not sizing correctly
    > the controls (.net is removing the with property during the rendering).


    I can't speak to your particular issue, but you might try using a stylesheet
    and then using the CssClass property on the web controls.

    John Saunders
    John Saunders, Nov 6, 2004
    #2
    1. Advertising

  3. What I'm trying to specify is the WIDTH of the controls, using .css is going
    to be difficult since the WIDTH is not standard for all controls.

    Thanks for your comment



    "John Saunders" wrote:

    > "Luis Fajardo" <> wrote in message
    > news:...
    > > I'm expiriencing a basic HTML appearance problem with ASP.NET. Following
    > > a
    > > couple of sample tags to ilustrate my problem:
    > >
    > > <asp:TextBox id="txtWidthIssue" runat="server" Width="100"></asp:TextBox>
    > > <asp:DropDownList id="ddlWidthIssue" runat="server"
    > > Width="100"></asp:DropDownList>
    > >
    > > Browser like Firefox and I'll imagine many others are not sizing correctly
    > > the controls (.net is removing the with property during the rendering).

    >
    > I can't speak to your particular issue, but you might try using a stylesheet
    > and then using the CssClass property on the web controls.
    >
    > John Saunders
    >
    >
    >
    =?Utf-8?B?THVpcyBGYWphcmRv?=, Nov 7, 2004
    #3
  4. "Luis Fajardo" <> wrote in message
    news:D...
    > What I'm trying to specify is the WIDTH of the controls, using .css is
    > going
    > to be difficult since the WIDTH is not standard for all controls.


    style="width:100px" isn't standard for all controls? I didn't know that.
    Which ones does it not work with?

    John

    > "John Saunders" wrote:
    >
    >> "Luis Fajardo" <> wrote in message
    >> news:...
    >> > I'm expiriencing a basic HTML appearance problem with ASP.NET.
    >> > Following
    >> > a
    >> > couple of sample tags to ilustrate my problem:
    >> >
    >> > <asp:TextBox id="txtWidthIssue" runat="server"
    >> > Width="100"></asp:TextBox>
    >> > <asp:DropDownList id="ddlWidthIssue" runat="server"
    >> > Width="100"></asp:DropDownList>
    >> >
    >> > Browser like Firefox and I'll imagine many others are not sizing
    >> > correctly
    >> > the controls (.net is removing the with property during the rendering).

    >>
    >> I can't speak to your particular issue, but you might try using a
    >> stylesheet
    >> and then using the CssClass property on the web controls.
    >>
    >> John Saunders
    >>
    >>
    >>
    John Saunders, Nov 8, 2004
    #4
  5. Johh, style="width: 100px" is standard, but what is happening is that if you
    try to specify that to your <asp:TextBox> or <asp:DropDownList> controls the
    ..NET designer REMOVES the style attribute from your controls, I think,
    because the style attribute is not available as part of the standard
    properties for these controls.

    In the other hand, if you use the Width property, in Firefox browser and I
    believe that also in Netscape, the rendering process REMOVES the Width clause
    on those browsers, and what happen is that you textbox and dropdownlist are
    display with NO WIDTH at all, letting the browser set a default size, too
    bad!!!!

    Give it a try! Unless I'm smoking something :)


    I think that I hear that there is a way to manipulate the RENDERING process
    to avoid these problems, but I don't remember. Any ideas?


    Thanks in advance,
    Luis






    "John Saunders" wrote:

    > "Luis Fajardo" <> wrote in message
    > news:D...
    > > What I'm trying to specify is the WIDTH of the controls, using .css is
    > > going
    > > to be difficult since the WIDTH is not standard for all controls.

    >
    > style="width:100px" isn't standard for all controls? I didn't know that.
    > Which ones does it not work with?
    >
    > John
    >
    > > "John Saunders" wrote:
    > >
    > >> "Luis Fajardo" <> wrote in message
    > >> news:...
    > >> > I'm expiriencing a basic HTML appearance problem with ASP.NET.
    > >> > Following
    > >> > a
    > >> > couple of sample tags to ilustrate my problem:
    > >> >
    > >> > <asp:TextBox id="txtWidthIssue" runat="server"
    > >> > Width="100"></asp:TextBox>
    > >> > <asp:DropDownList id="ddlWidthIssue" runat="server"
    > >> > Width="100"></asp:DropDownList>
    > >> >
    > >> > Browser like Firefox and I'll imagine many others are not sizing
    > >> > correctly
    > >> > the controls (.net is removing the with property during the rendering).
    > >>
    > >> I can't speak to your particular issue, but you might try using a
    > >> stylesheet
    > >> and then using the CssClass property on the web controls.
    > >>
    > >> John Saunders
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?THVpcyBGYWphcmRv?=, Nov 8, 2004
    #5
  6. "Luis Fajardo" <> wrote in message
    news:...
    > Johh, style="width: 100px" is standard, but what is happening is that if
    > you
    > try to specify that to your <asp:TextBox> or <asp:DropDownList> controls
    > the
    > .NET designer REMOVES the style attribute from your controls, I think,
    > because the style attribute is not available as part of the standard
    > properties for these controls.


    I said that you should try creating a stylesheet and referring to the
    classes in the stylesheet with the CssClass attribute on the web controls.
    That will not be removed.

    John
    John Saunders, Nov 9, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bruce barker
    Replies:
    1
    Views:
    1,321
    David
    Aug 13, 2003
  2. Alex
    Replies:
    4
    Views:
    438
    Steven Campbell
    Aug 20, 2003
  3. Alex

    Hyperlink appearance

    Alex, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    353
  4. Replies:
    4
    Views:
    426
    Andrew Thompson
    Apr 21, 2007
  5. Mike

    browser - change appearance using ASP

    Mike, Jan 2, 2005, in forum: ASP General
    Replies:
    4
    Views:
    108
    Evertjan.
    Jan 3, 2005
Loading...

Share This Page