all groups > asp.net building controls > july 2003 >
You're in the

asp.net building controls

group:

Page Access


Page Access Shawn B.
7/30/2003 11:37:18 PM
asp.net building controls:
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

Re: Page Access Teemu Keiski
7/31/2003 4:48:57 PM
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

[quoted text, click to view]

AddThis Social Bookmark Button