Inherits属性は、継承するページの分離コードクラスを指定する。
名前空間も含めて指定できるので、同じファイル、同じクラス名、違う名前空間の場合に対応。
Inherits.csが、
の場合、
Inherits.aspxが、
<%@ Page Language="C#" CodeFile="Inherits.cs" Inherits="Inherits1.Inherits" %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title id="title_index">Inherits</title> </head> <body> <% Response.Write(Method1()); %> </body> </html>
なら、

こうなる。
なら、

こうなる。
Sample/aspnet/PageDirective/Inherits/src/PageDirective at master · bg1bgst333/Sample · GitHub