.html和.aspx文件有什么区别? [英] What is difference between .html and .aspx files?

查看:335
本文介绍了.html和.aspx文件有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个网页在asp.net中包含三种类型的文件。

1] Page.aspx

2] Page.aspx.cs

3] Page.aspx.designer.cs



.cs和.designer.cs都是部分类。所以我可以访问两个类之间的方法和属性。他们作为一个班级编写,但随后Page.aspx进入画面。 Page.aspx就像一个HTML页面。

.aspx页面下面的行非常混乱。 html页面如何继承一个类?



One web page contains three type of files in asp.net.
1] Page.aspx
2] Page.aspx.cs
3] Page.aspx.designer.cs

.cs and .designer.cs both are partial classes. So I can access method and properties between two classes. they complied as one class but then where the Page.aspx comes into the picture. Page.aspx is like an HTML page.
Below line in .aspx page is very confusing. how can a html page inherit a class?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>





我可以关联一个clas带有正常html文件的文件?



Can I associate a class file with a normal html file?

推荐答案

很抱歉,但您的问题不明确。不用担心。



我认为您找到的代码 ASP.NET Web应用程序(Visual C#) [ ^ ]您对几种文件的类型有点混淆。以下是一些描述: Visual Basic中的文件类型和文件扩展名Visual C# [ ^ ]。



我建议你从基础开始:使用ASP.NET开发Web应用程序 [ ^ ]
Sorry, but your question is not clear. Not to worry.

I think you found a code of ASP.NET Web Application (Visual C#)[^] and you're bit confusing with several file's types. Here is a bit of description: File Types and File Extensions in Visual Basic and Visual C#[^].

I' suggest you to start with basics: Developing Web Applications with ASP.NET[^]


差异 [ ^ ]

请在此处查看,您将了解到。 :)

.aspx 是视图页面

.aspx.cs 是功能/事件所在的类定义

.aspx.designer.cs 允许Visual Studio在设计时创建的服务器控件的代码隐藏页面中为用户提供IntelliSense。



假设我们在视图页面上有一个按钮,即.aspx,并且.aspx.cs中定义了click事件。

谢谢

希望这会有所帮助。

:)
Difference[^]
Please check here, you will get to know. :)
.aspx is the viewpage
.aspx.cs is the class where the functionalities/events are defined
.aspx.designer.cs allows Visual Studio to give the user IntelliSense in the code-behind page for server controls created at design-time.

Like suppose we have a button on the view page i.e. .aspx and the click event is defined in the .aspx.cs.
Thanks
Hope this helps.
:)


这篇关于.html和.aspx文件有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆