Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
作成したインターフェイス クラスを実装する必要がある ASP.Net ページがありますが、このページのコードはインラインであるため、クラス宣言がなく、「Implements IMyInterface」行を配置する場所がありません。@interface page ディレクティブも使用してみましたが、これは組み込みの .Net フレームワーク クラスでのみ機能するようです。
クラス宣言行を編集するためだけにコードビハインド ページを使用する以外にオプションはありますか?
Implements ディレクティブでそれを行うことができます。
<%@ Implements Interface="MyNamespace.IMyInterface" %>
私はそうは思わない。inherits ディレクティブを使用して基本クラスを指定できます。Page から派生したクラスを作成し、このクラスにインターフェイスを実装できます。