473,386 Members | 1,748 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,386 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 5131
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.