Many novice friends do not know how to overload the ASP.net method, the following is introduced in the design of overloaded methods should pay attention to matters, interested friends do not miss
Determining whether a method constitutes an overload has several conditions: in the same class; method names are the same; argument lists. When designing overloaded methods you should pay attention to things 1 Avoid changing the name of the parameter in the overload arbitrarily. If one of the overloads of an overload represents the same input as a parameter of another overload, the two arguments should have the same name. For example, do not perform the following Operation: code as follows: public void write (string message, FileStream stream) {} public void write (str ing line, FileStream file,bool closestream) {} The correct definition of these overloads is as follows code as follows: public void Write (String message, Fil eSTREAM stream) {} public void Write (String message, FileStream stream,bool closestream) {} Maintains sequential consistency of overloaded member parameters. In all overloads, the position of the same parameter should be the same. For example, do not perform the following Operation: code as follows: public void write (string message, FileStream stream) {} public void Write (Fil eSTREAM stream, String message, bool Closestream) {} The correct definition of these overloads is as follows: code: public void Write (string Messa GE, FileStream stream) {} public void Write (String message, FileStream stream,bool closestream) {} both The method structure is clear, enhances the readability of the code, is more suitable for the specification. This guideline has two constraints:   If the overload takes a variable argument list, the list must be the last parameter. If the overload takes out parameters, by convention, such parameters should be used as the last parameter If extensibility is required, the longest overload is used as a virtual overload. A shorter overload should only step through a longer overload. The difference between and override overrides override refers to the inheritance of methods between the parent class and the subclass, which have the same name and parameter type.