>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only