简体   繁体   中英

Single ASPX page - No code behind - Page Directive

I have a single aspx page with no code behind with a directive like the following below.

<%@ page title="Test" language="C#" masterpagefile="Test.master" 
autoeventwireup="true" inherits="TestScenario, TestScenario2" %>

Where do I need to look for the code (in VS)for the info that the Inherits attibute is pointing to.

Which page does the inherirtance refer to so that I can physically go look at what the page does.

This is a follow up to my previous question https://stackoverflow.com/questions/14278082/no-code-behind-aspx-page-page-directive .

Any info or few sentences on how a single page (with no code behind) is tied to the inherit attribute in the Page directive is much appreciated.

TestScenario, TestScenario2 is an assembly qualified type name .

Look for a class called TestScenario in a project that creates an assembly called TestScenario2 . If you're lucky, the file will be at TestScenario2\\TestScenario.cs , relative to your solution folder.

In Visual Studio, go to a .cs file and type TestScenario OR TestScenario2. Right click on the TestScenario OR TestScenario2 you typed and click on 'Go To Definition'. You can see where those classes are defined.

But in normal case when an ASP page is added with no .cs file, you can add a .cs file by placing the CodeFile="~/Path" in the Page directive.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM