Page Access

S

Shawn B.

Greetings,

Is there a way, from inside a custom WebControl, that I can modify the
attributes of the parent page? I ask because if a certain property is set
in my WebControl, I would like it to add an attribute (onResize, for
example) to the page's <Body> tag that calls some JavaScript it registers.


Thanks,
Shawn
 
T

Teemu Keiski

Specify the body tag with runat="server" attribute and give it an ID. Then
you could access it from custom control by using
Page.FindControl("ID_of_Body_tag").

But if the Page needs to work without anything like this i.e must not need
to be aware of this, I believe it is bit a problem. <body> tag is normally
contained in Page's Controls at index 0 (default scenario) in a
LiteralControl where all the static, non-server control content is.

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top