By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

body.style?

P: n/a
<body id="body"
style="background-image:url(../../Pictures/System/CountryMosaic.JPG)">

how do i get/set body.style from asp.net?
Mar 4 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
'//You need to set the Runat attribute to server and give it an ID.
<body id="body" runat=server style="MARGIN-LEFT: 20px" vLink="#0000ff">

'//Declare the variable In the designer section
Protected body As System.Web.UI.HtmlControls.HtmlGenericControl

'//In your page load event ( or wherever ) use it
Response.Write(body.Attributes("style").ToString)

--
Terry Burns
http://TrainingOn.net

"Progman" <ad*******@hotmail.com> wrote in message
news:l7********************@weber.videotron.net...
<body id="body"
style="background-image:url(../../Pictures/System/CountryMosaic.JPG)">

how do i get/set body.style from asp.net?

Mar 4 '06 #2

P: n/a
I tried thi`s:
<body id="body" runat="server"

then you will be able to this
body.style = "background-Image...."

but the compiler says, style is read-only

shit...
"Progman" <ad*******@hotmail.com> wrote in message
news:l7********************@weber.videotron.net...
<body id="body"
style="background-image:url(../../Pictures/System/CountryMosaic.JPG)">

how do i get/set body.style from asp.net?

Mar 4 '06 #3

P: n/a
i need to set the style attribute.
will this do it?

"Terry Burns" <me@mine.com> wrote in message
news:u7**************@TK2MSFTNGP14.phx.gbl...
'//You need to set the Runat attribute to server and give it an ID.
<body id="body" runat=server style="MARGIN-LEFT: 20px" vLink="#0000ff">

'//Declare the variable In the designer section
Protected body As System.Web.UI.HtmlControls.HtmlGenericControl

'//In your page load event ( or wherever ) use it
Response.Write(body.Attributes("style").ToString)

--
Terry Burns
http://TrainingOn.net

"Progman" <ad*******@hotmail.com> wrote in message
news:l7********************@weber.videotron.net...
<body id="body"
style="background-image:url(../../Pictures/System/CountryMosaic.JPG)">

how do i get/set body.style from asp.net?


Mar 4 '06 #4

P: n/a
Style is readonly, but you can set this using the attibutes collection

Control.Attributes.Item("style") = " your style attributes "
--
Terry Burns
http://TrainingOn.net


"Progman" <ad*******@hotmail.com> wrote in message
news:7K********************@weber.videotron.net...
I tried thi`s:
<body id="body" runat="server"

then you will be able to this
body.style = "background-Image...."

but the compiler says, style is read-only

shit...
"Progman" <ad*******@hotmail.com> wrote in message
news:l7********************@weber.videotron.net...
<body id="body"
style="background-image:url(../../Pictures/System/CountryMosaic.JPG)">

how do i get/set body.style from asp.net?


Mar 4 '06 #5

P: n/a
ok found it
<body id="body1" runat="server" >

Me.body1.Attributes("style") =
"background-image:url(../../Pictures/System/CountryMosaic.JPG)"

"Progman" <ad*******@hotmail.com> wrote in message
news:a3********************@weber.videotron.net...
i need to set the style attribute.
will this do it?

"Terry Burns" <me@mine.com> wrote in message
news:u7**************@TK2MSFTNGP14.phx.gbl...
'//You need to set the Runat attribute to server and give it an ID.
<body id="body" runat=server style="MARGIN-LEFT: 20px" vLink="#0000ff">

'//Declare the variable In the designer section
Protected body As System.Web.UI.HtmlControls.HtmlGenericControl

'//In your page load event ( or wherever ) use it
Response.Write(body.Attributes("style").ToString)

--
Terry Burns
http://TrainingOn.net

"Progman" <ad*******@hotmail.com> wrote in message
news:l7********************@weber.videotron.net...
<body id="body"
style="background-image:url(../../Pictures/System/CountryMosaic.JPG)">

how do i get/set body.style from asp.net?



Mar 4 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.