Thanks for Anthony's inputs.
Yes, the "OnLoadComplete" attribute should not exists in @Page directive.
Generally a typical page event registering is like below(if you use inline
server code):
===============================
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="PageEventTest.aspx.cs" Inherits="PageEventTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script runat="server" language="C#">
protected void Page_LoadComplete(object sender, EventArgs e)
{
Response.Write("<br/>Page_LoadComplete");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
=========================
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Anthony Jones" <An*@yadayadayada.com>
References: <0B**********************************@microsoft.co m>
Subject: Re: Attribute 'OnLoadComplete' is not a valid attribute of
element 'Pa
>Date: Wed, 20 Aug 2008 23:09:25 +0100
>
"mpaine" <mp****@community.nospamwrote in message
news:0B**********************************@microso ft.com...
>So this one is confusing as everything works but I want this warning to
go
>away. This is what I have (within a .NET 2.0 Web Application, using
VS.NET
>2008 SP1):
default.aspx:
<%@ Page Language="C#" OnLoadComplete="Page_LoadComplete" %>
Where did you get the idea for the above attribute??
This is sufficient:-
<%@ Page Language="C#" %>
><%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web" %>
It would be strange config if the above two namespaces were not already
present in the config, drop these imports.
><script runat="server">
protected void Page_LoadComplete(object sender, EventArgs e)
{
// anything here..
}
</script>
--
Anthony Jones - MVP ASP/ASP.NET