Wednesday, January 16, 2008

How do I call client onload from ASP.NET ContentPage?

When we use ASP.NET Master Page inside our web application, body tag automatically remove from content pages. Coz, at runtime Master page body tag render as content page body tag. But the problem arises when we want to access the content page body element. Just say we want to call JavaScript function from client page body onload event.

With ASP.NET, we call solve this issue with some extra code.

Step 1: Set ID and runat tag for Master Page body element.

FAQ00016_1

Step 2: Put below code inside the content page load event.

FAQ00016_2

Labels:

1 Comments:

At February 21, 2008 3:19 AM, Anonymous Darren said...

Nice and simple. Thanks!

 

Post a Comment

<< Home