Problem with .Attributes.Add ("style","overflow :hidden");

Discussion in 'ASP .Net' started by =?Utf-8?B?U0FM?=, Jul 28, 2006.

  1. I have the following line of code in my Page_Load Event of my ASP.net page:
    txtExplanationofChange.Attributes.Add ("style","overflow :hidden");
    which allows me to can turn off the Scrollbar of my multiline textbox. I am
    still fairly new to developing in ASP.net and C#, and I'm not sure if there
    is a better way to disable the scrollbar.

    The code above turns off the scrollbar just fine, however the textbox does
    not remain in the location where I had placed it on the webpage in design
    mode. All the controls I have on my webpage stay in the position where I put
    them in design mode, except for this textbox.

    Is there something I am doing wrong? Is there another property I need to set?

    Is there a better way to turn off the scrollbar than the way I am doing it?

    Thanks,
     
    =?Utf-8?B?U0FM?=, Jul 28, 2006
    #1
    1. Advertisements

  2. Arthur Dent

    Arthur Dent Guest

    Well, for one, instead of using Attributes, you should use Style.... it
    allows you to easily add multiple styles if needed too.

    myControl.Style.Add("overflow", "hidden")

    I dont know if this would help your positioning problem though.


    "SAL" <> wrote in message
    news:...
    >I have the following line of code in my Page_Load Event of my ASP.net page:
    > txtExplanationofChange.Attributes.Add ("style","overflow :hidden");
    > which allows me to can turn off the Scrollbar of my multiline textbox. I
    > am
    > still fairly new to developing in ASP.net and C#, and I'm not sure if
    > there
    > is a better way to disable the scrollbar.
    >
    > The code above turns off the scrollbar just fine, however the textbox does
    > not remain in the location where I had placed it on the webpage in design
    > mode. All the controls I have on my webpage stay in the position where I
    > put
    > them in design mode, except for this textbox.
    >
    > Is there something I am doing wrong? Is there another property I need to
    > set?
    >
    > Is there a better way to turn off the scrollbar than the way I am doing
    > it?
    >
    > Thanks,
     
    Arthur Dent, Jul 28, 2006
    #2
    1. Advertisements

  3. Thank you Arthur. It worked perfectly. All the controls remained where I
    placed them in design time.

    I'll have to read up on Style to know more about what it can do since like I
    said I'm new to C# and ASP.net.

    Thanks again

    "Arthur Dent" wrote:

    > Well, for one, instead of using Attributes, you should use Style.... it
    > allows you to easily add multiple styles if needed too.
    >
    > myControl.Style.Add("overflow", "hidden")
    >
    > I dont know if this would help your positioning problem though.
    >
    >
    > "SAL" <> wrote in message
    > news:...
    > >I have the following line of code in my Page_Load Event of my ASP.net page:
    > > txtExplanationofChange.Attributes.Add ("style","overflow :hidden");
    > > which allows me to can turn off the Scrollbar of my multiline textbox. I
    > > am
    > > still fairly new to developing in ASP.net and C#, and I'm not sure if
    > > there
    > > is a better way to disable the scrollbar.
    > >
    > > The code above turns off the scrollbar just fine, however the textbox does
    > > not remain in the location where I had placed it on the webpage in design
    > > mode. All the controls I have on my webpage stay in the position where I
    > > put
    > > them in design mode, except for this textbox.
    > >
    > > Is there something I am doing wrong? Is there another property I need to
    > > set?
    > >
    > > Is there a better way to turn off the scrollbar than the way I am doing
    > > it?
    > >
    > > Thanks,

    >
    >
    >
     
    =?Utf-8?B?U0FM?=, Jul 28, 2006
    #3
    1. Advertisements

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. Richard Rundle

    Use of overflow: hidden; on nested divs

    Richard Rundle, Dec 18, 2005, in forum: HTML
    Replies:
    0
    Views:
    778
    Richard Rundle
    Dec 18, 2005
  2. Replies:
    15
    Views:
    1,201
    ironcorona
    May 8, 2006
  3. P4trykx
    Replies:
    2
    Views:
    2,100
    bruce barker
    Jan 31, 2007
  4. SolarCanine
    Replies:
    2
    Views:
    567
    SolarCanine
    Sep 20, 2005
  5. Replies:
    2
    Views:
    191
Loading...