473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 5133
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
5
by: Charles Blaquière | last post by:
As part of my explorations in liquid design, I'm exploring ways to use the overflow: hidden property -- when browser windows become too narrow, I want (some) images to get cropped rather than have...
32
by: Indrid Colt | last post by:
Thank's for your help ! Indrid
1
by: JJ | last post by:
I am trying to stop my layout spoiling when a textbox with a width of 100% has a large amount of text in it. On the master page I have tried using a div with style="overflow:auto", and this work...
7
by: parag1234567 | last post by:
Hi, I am dynamically generating a html file which will contain only <div> tags which contents are hidden from user( set by style="visibility:hidden") Now the next step is i am enabling some of...
5
by: Christopher Night | last post by:
I'm making a Javascript program that uses overflow:hidden on a containing div to crop an image. This page (temporarily) shows an example of what I mean: ...
4
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an...
1
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
4
by: aashen | last post by:
I'm building a new site and using the Lightbox2 photo gallery(http://www.huddletogether.com/projects/lightbox2/). I have several images...each open up their own gallery. I was having a problem with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.