473,327 Members | 1,930 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,327 software developers and data experts.

Style Sheet CLASS

A.M
Hi,

How can I change the CLASS property of a server control inside code behin's
Page_Load event?

I can see the class property in Properties window, but I don't have "class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali
Nov 18 '05 #1
10 3436
A.M
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code

behin's
Page_Load event?

I can see the class property in Properties window, but I don't have

"class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali


Nov 18 '05 #2
A.M

I am working with "System.Web.UI.HtmlControls.HtmlTableCell" server side
control which doesn't have CssClass property!!

"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code behin's Page_Load event?

I can see the class property in Properties window, but I don't have "class" (the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali

Nov 18 '05 #3
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code behin's Page_Load event?

I can see the class property in Properties window, but I don't have "class" (the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali

Nov 18 '05 #4
Why not just use a regular table and give the particular cell and ID? Then
you can access the <TD>'s style property directly?
"A.M" <IH*******@sapm123.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code

behin's
Page_Load event?

I can see the class property in Properties window, but I don't have

"class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali



Nov 18 '05 #5
A.M
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code

behin's
Page_Load event?

I can see the class property in Properties window, but I don't have

"class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali


Nov 18 '05 #6
Why not just use a regular table and give the particular cell and ID? Then
you can access the <TD>'s style property directly?
"A.M" <IH*******@sapm123.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code

behin's
Page_Load event?

I can see the class property in Properties window, but I don't have

"class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali



Nov 18 '05 #7
It has an Attributes Collection, to which you can add any HTML attribute you
want to the tag. Example:

MyTableCell.Attributes.Add("class", "MyCssClass");

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm123.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code

behin's
Page_Load event?

I can see the class property in Properties window, but I don't have

"class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali



Nov 18 '05 #8
A.M
Thanks Kevin!

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
It has an Attributes Collection, to which you can add any HTML attribute you want to the tag. Example:

MyTableCell.Attributes.Add("class", "MyCssClass");

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm123.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> How can I change the CLASS property of a server control inside code
behin's
> Page_Load event?
>
> I can see the class property in Properties window, but I don't have
"class"
> (the stylesheet class) as control's class (C# class) properties .
>
> Thanks,
> Ali
>
>



Nov 18 '05 #9
It has an Attributes Collection, to which you can add any HTML attribute you
want to the tag. Example:

MyTableCell.Attributes.Add("class", "MyCssClass");

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm123.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any
way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Hi,

How can I change the CLASS property of a server control inside code

behin's
Page_Load event?

I can see the class property in Properties window, but I don't have

"class"
(the stylesheet class) as control's class (C# class) properties .

Thanks,
Ali



Nov 18 '05 #10
A.M
Thanks Kevin!

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
It has an Attributes Collection, to which you can add any HTML attribute you want to the tag. Example:

MyTableCell.Attributes.Add("class", "MyCssClass");

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm123.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
System.Web.UI.HtmlControls.HtmlTableCell doesn't have that !! Is there any way to do that without cssClass?

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:u4*************@TK2MSFTNGP11.phx.gbl...
There should be a .CSSClass property of the control.
"A.M" <IH*******@sapm123.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> How can I change the CLASS property of a server control inside code
behin's
> Page_Load event?
>
> I can see the class property in Properties window, but I don't have
"class"
> (the stylesheet class) as control's class (C# class) properties .
>
> Thanks,
> Ali
>
>



Nov 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Bradbury | last post by:
I may be thinking about this the wrong way, but here goes: In my style sheet I've specified that bullet points should use a specific image rather than just be default bullet points. However, at...
1
by: Hank Flowers | last post by:
In trying to load a style sheet via JavaScript I ran into a problem...the style sheet doesn't load. This simple task has turned into a vexing problem. Here is the script and html: <html> <head>...
9
by: lkrubner | last post by:
How do I get all the div's on a page? I realize in IE I can use document.all. For the other browsers, I need to get an array of all the divs on the page. getElementByTagName()?????
3
by: joealey2003 | last post by:
Hi all... I included a css file on my html and i need to check some properties. The html is: <style id="myid" src="mycsspage.css"> </style> Now i need something to access it like: ...
3
by: Irfan Akram | last post by:
Hi Guys, Where do we specify style sheets link, so that it is used through the asp.net web-application? Will wait for a useful response, Thanks, I.A..
2
by: Warren Machanik | last post by:
I am a relative newbee I am having problems with applying a style on a style sheet. I have created a div and created a class. In the style sheet file I did the following: "div.TopBar {...
8
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{...
10
by: pamelafluente | last post by:
Hi, this time I am trying to add a style on the fly.I wish equivalency with this one (only the menuItemStyle line): <head> <style type="text/css" media="screen"> ... some static styles ......
3
by: Martin Bretschneider | last post by:
Hi, ms word should output xhtml without any css style. Tidy (http://tidy.sourceforge.net/) helps quite a lot but leaves the css styles like the following: <p class="P11 c2">foo</p> <ul...
4
Frinavale
by: Frinavale | last post by:
So a while ago I created a Tab Strip Control (before the AjaxToolkit had theirs otherwise I would have probably just used theirs). When I looked at the AjaxToolkit control to see how they got...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.