You would add the body with the onkeydown attribute to the master page.
Now, if you only want this on some pages, you can try this:
In the master page:
<body id="hgcMasterBody" runat="server">
.....
</body>
In the ASPX page:
<%@ MasterType virtualpath="MyMasterPage.master" %>
.....
<script runat="server">
Master.hgcMasterBody.Attributes["onkeydown"] =
"catchKeyPress(window.event.keyCode, window.event.srcElement);";
......
</script>
.....
I haven't tried this myself, so you may have to tweak it a bit.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."
"Roberto Kohler" <> wrote in message
news:%...
>I am trying to add a body event handler to a page that uses a masterpage.
> I need to do something like:
>
> <body onkeydown="catchKeyPress(window.event.keyCode,
> window.event.srcElement);">
>
> The problem is that when the page uses a masterpage, I can't add a <body>
> tag.
> How do I set a body event handler when a page uses masterpages ?
>
>
|