Use Master page <body> tag in Content page of

How to use the <body> onclick from content page in

Master page is introducing from 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 forum. Original link:


<%@ 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');'none';

document.body.onclick= ClearBox;


    <input id="Button1" type="button" value="button" />

For more info pls visit:


Anonymous said…
hello,simple but helpful.
Ahsan Murshed said…
welcome,thanks for your feedback, I always try to share important info which is helpful for all.
MyProgramming said…
ok fine next
Anonymous said…
This is very fine web site, thank you and look at that [url=http;//]gry dla dzieci[/url]
Anonymous said…
Good point, though sometimes it's hard to arrive to definite conclusions
Anonymous said…
good start
Anonymous said…
thanks for the interesting information

Popular posts from this blog

How can I get a value of a property from an anonymous type (C#)

The model backing the 'MyDBContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.

"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet."