472,141 Members | 1,026 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

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

SAL
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,
Jul 28 '06 #1
2 4973
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" <SA*@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.com...
>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,

Jul 28 '06 #2
SAL
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" <SA*@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.com...
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,


Jul 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JJ | last post: by
5 posts views Thread by Christopher Night | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.