gpt4 book ai didi

c# - asp.net 页面上的预设格式。

转载 作者:太空宇宙 更新时间:2023-11-03 21:44:23 24 4
gpt4 key购买 nike

我是 Asp.net 的新手。我继承了一个网络应用程序元素。当我创建一个新页面时,它的顶部已经有一些格式,即使我在创建页面时没有使用任何母版页。这是我在构建页面时可以看到的。我使用的是 ASP.Net 4.0,C# 语言。

我终究无法弄清楚,因为在文件的底层代码中,没有对任何 css 或任何元素的引用。 page.aspx的代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
</body>
</html>

后面的代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}

提前感谢我能得到的任何帮助。

最佳答案

哦,其实当你在 Visual Studio 中创建页面时。他默认创建一些代码文件和元素结构。这就是为什么您在解决方案上显示不同类型的文件。

在您的 aspx 页面标题上查看其将 cs 代码文件定义为 CodeFile="Test.aspx.cs"以及 Inherits 测试。 还有包含程序集引用的 .csproj 文件 包含当前元素和所有引用元素的.projRefs.sln 文件

关于c# - asp.net 页面上的预设格式。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21407376/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com