I am using ASP master pages, and I want to add an "onkeypress" event handler to I will add a public property to the masterpiece, such as This is the air code because I do not have a project to test. But this should be something like this: Masterpage markup: Masterpage codewind: & lt
bodynetwork
. Then set the on-line feature of Body Tag in the masterpages prerender event. The client pages must set this property before the fire of the master's prerender event.
& lt;% - Route = mark the body tag with "server", and give it an ID Context in code -%> & Lt; Body id = "mainBody" runat = "server" & gt; ... & lt; / Body & gt;
Secure Zero Page_ PreRender (...) {mainBody.Attributes ["onkeypress"] = this.BodyOnKeyPress; } Public string BodyOnKeyPress {Get [Return ViewState ["BodyOnKeyPress"]; } Set {ViewState ["BodyOncation"] = Value; }}
Comments
Post a Comment