简体   繁体   English

单个ASPX页面-后面没有代码-页面指令

[英]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. 我有一个aspx页面,后面没有任何代码,后面没有如下指令。

<%@ 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. 我需要在哪里查找Inherits外观所指向的信息的代码(在VS中)。

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 . 这是我之前的问题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. 关于将单个页面(没有任何代码)如何与Page指令中的Inherited属性绑定的任何信息或几句话,将受到赞赏。

TestScenario, TestScenario2 is an assembly qualified type name . TestScenario, TestScenario2程序集限定的类型名称

Look for a class called TestScenario in a project that creates an assembly called TestScenario2 . 在创建一个名为TestScenario2的程序集的项目中查找一个名为TestScenario的类。 If you're lucky, the file will be at TestScenario2\\TestScenario.cs , relative to your solution folder. 如果幸运的话,该文件将位于相对于您的解决方案文件夹的TestScenario2\\TestScenario.cs

In Visual Studio, go to a .cs file and type TestScenario OR TestScenario2. 在Visual Studio中,转到.cs文件,然后键入TestScenario或TestScenario2。 Right click on the TestScenario OR TestScenario2 you typed and click on 'Go To Definition'. 右键单击您键入的TestScenario或TestScenario2,然后单击“转到定义”。 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. 但是在通常情况下,当添加没有.cs文件的ASP页时,可以通过在Page指令中放置CodeFile =“〜/ Path”来添加.cs文件。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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