Master page is introducing from asp.net 2.0, this is the main layout page for whole application content page just inherit it.
So that,we get the <body> tag only in Master page,in content page there is no body tag. But I need to use this body tag from content page.
After search it I found a solution in asp.net forum. Original link: http://forums.asp.net/t/1062445.aspx
Sample:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" Title="Test Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
function ClearBox()
{
var divBoxID=document.getElementById('BoxDiv');
divBoxID.style.display='none';
}
document.body.onclick= ClearBox;
</script>
<input id="Button1" type="button" value="button" />
</asp:Content>
For more info pls visit:
http://msdn.microsoft.com/en-us/library/7a9d6h4f.aspx
http://forums.asp.net/t/1225951.aspx
6 comments:
hello,simple but helpful.
welcome,thanks for your feedback, I always try to share important info which is helpful for all.
ok fine next http://hasanprogram.blogspot.com/
Good point, though sometimes it's hard to arrive to definite conclusions
good start
thanks for the interesting information
Post a Comment