Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with .Attributes.Add ("style","overflow :hidden");

Reply
Thread Tools

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

 
 
=?Utf-8?B?U0FM?=
Guest
Posts: n/a
 
      07-28-2006
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,
 
Reply With Quote
 
 
 
 
Arthur Dent
Guest
Posts: n/a
 
      07-28-2006
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:94F76925-C913-4272-A629-...
>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,



 
Reply With Quote
 
 
 
 
=?Utf-8?B?U0FM?=
Guest
Posts: n/a
 
      07-28-2006
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:94F76925-C913-4272-A629-...
> >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,

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57