我不明白AutoEventWireUp页面属性负责什么.
在网上冲浪时,我发现很多论坛都有关于它的讨论,它们对我来说都显得有些不一致.
我能否清楚解释这个属性究竟意味着什么?
我已经阅读了这篇文章,但即使我不理解.
通常当Page_LoadVisual Studio 将事件处理程序添加到代码隐藏文件时(例如,在设计器模式下双击页面),它最终看起来像这样:
/// <summary>
/// Handles the Load event of the Page control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected void Page_Load(object sender, EventArgs e)
{
// ...
}
Run Code Online (Sandbox Code Playgroud)
但是Resharper建议道Name 'Page_Load' does not match rule 'Methods, properties and events'. Suggested name is 'PageLoad'.我猜有一种更好的方法来定义页面加载的处理程序,但我不记得语法是什么,但我想它会解决这个Resharper警告?
也许是这样的:
/// <summary>
/// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
/// </summary>
/// <param name="e">The <see cref="T:System.EventArgs"/> object that contains …Run Code Online (Sandbox Code Playgroud)