Thông thường khi xử lý Page_Load
kiện được thêm vào một tập tin codebehind bởi Visual Studio (ví dụ như đôi cách nhấn vào trang trong chế độ thiết kế), nó sẽ trông như thế này:Resharper gợi ý Page_Load = PageLoad
/// <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)
{
// ...
}
Nhưng Resharper gợi ý Name 'Page_Load' does not match rule 'Methods, properties and events'. Suggested name is 'PageLoad'
. Tôi đoán có một cách tốt hơn để xác định xử lý để tải trang, nhưng tôi không thể nhớ cú pháp là gì, nhưng tôi tưởng tượng nó sẽ giải quyết cảnh báo Resharper này?
Có lẽ cái gì đó như:
/// <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 the event data.</param>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
// ...
}
nhưng tôi dường như nhớ lại rằng OnLoad
và PageLoad
không giống hệt nhau?
Đó là một liên kết hữu ích với giải thích tốt. cổ vũ. :) –