Page_Load suggested name PageLoad? Follow
Usually when the page_load event handler is added to a codebehind file by Visual Studio (e.g. double clicking the page in designer mode), it ends up looking like this:
/// <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)
{
// ...
}
But resharper suggests "Name 'Page_Load' does not match rule 'Methods, properties and events'. Suggested name is 'PageLoad'."
I'm guessing there's a better way to define the handler for page load, but I can't remember what the syntax is, but I imagine it would resolve this resharper warning?
// ...
}
But resharper suggests "Name 'Page_Load' does not match rule 'Methods, properties and events'. Suggested name is 'PageLoad'."
I'm guessing there's a better way to define the handler for page load, but I can't remember what the syntax is, but I imagine it would resolve this resharper warning?
Please sign in to leave a comment.
If you go to ReSharper Options, under Languages select C# Naming Style. Select the Advanced settings... button and in the Event subscriptions on fields:, remove the On in front of $event$ so it is $object$_$event$. That should remove the warning.