Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to Document HTML tags
Message
From
12/10/2005 09:14:56
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01057992
Message ID:
01058292
Views:
19
>Does anyone know if it is possible to hook into server events from a custom server control and write lines of script and attributes inside tags such as head, body attributes and html attributes?
>
>For example a custom control that requires some script to be added to the head section, and attributes added to body and html as well as the rendered html where the control is dropped?

Unfortunately, the answer is no. The reason is that all server-side controls exist in a form, and the form comes after the header HTML.

However, a different way to accomplish what you want is to create a class that inherits System.Web.IU.Page that iterates through all of the controls that it contains and sets its own attributes according to the properties of the controls. You can either look for a type of control - TypeOf() - or use reflection to look for the existence of a property that indicates that the control has data for the Page to add to its HTML.
Previous
Reply
Map
View

Click here to load this message in the networking platform