Microsoft KB Archive/318279

= BUG: The page event handler may insert an incorrect event name when you automatically generate a page event handler =

Article ID: 318279

Article Last Modified on 12/11/2006

-

APPLIES TO


 * Microsoft Visual C# .NET 2002 Standard Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft Visual C# 2005 Express Edition

-



This article was previously published under Q318279



SYMPTOMS
When you automatically generate a page event handler, the automatically-generated page event handler is named WebForm1_Load, but the Page_Load event handler is connected to the function.



RESOLUTION
To resolve this problem, replace the WebForm1_Load event name with Page_Load in the WebForm1.aspx.cs file.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior

 * 1) In Visual Studio .NET or in Visual Studio 2005, create a new Visual C# ASP.NET Web Application project.
 * 2) Open the code-behind file for the Webform1.aspx file, and then delete the Page_Load function.
 * 3) Switch to Design view for the Webform1.aspx file.
 * 4) In the Properties window, select WebForm1 from the drop-down list.
 * 5) Click Events.
 * 6) Double-click the Load event in the Properties window. Although you expect a new function named Page_Load to be created, the new function is named WebForm1_Load.

Additional query words: kbnetsearch kbCsharpNet Page_Load WebForm1_Load page event asp web

Keywords: kbtshoot kbprb kbbug kbpending kbwebforms KB318279

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.