📜  ASP 和 ASP.NET 之间的区别

📅  最后修改于: 2022-05-13 01:56:29.860000             🧑  作者: Mango

ASP 和 ASP.NET 之间的区别

ASP: ASP 代表Active Server Pages 。它是用于构建网页的开发框架。 ASP 于 1998 年由 Microsoft 引入,作为其第一个服务器端脚本语言。 ASP 页面的文件扩展名为 .asp,通常用 VBScript 编写。它是制作动态网页的一个古老但仍然强大的工具。 ASP 是一种用于在 Web 服务器上执行脚本的技术(很像PHP)。
例子:

html


 

    <%response.write("Welcome to GeeksforGeeks!")%>

 


csharp
@{
    var rank = 50;
}


@if (rank < 60)
{
    

Welcome to GeeksforGeeks!

}


输出:

Welcome to GeeksforGeeks!

ASP.NET:ASP.NET于 2002 年由 Microsoft 作为 ASP 的继任者发布。它也是一个服务器端 Web 框架,开源,专为生成动态网页而设计。 ASP.NET 页面的文件扩展名为 .aspx,通常用 C# (C sharp) 编写。 ASP.NET 的最新版本是 ASP.NET 4.6。
例子:

夏普

@{
    var rank = 50;
}


@if (rank < 60)
{
    

Welcome to GeeksforGeeks!

}

输出:

Welcome to GeeksforGeeks!

ASP 和 ASP.NET 的区别:

ASPASP.NET
ASP is the interpreted language.ASP.NET is the compiled language.
ASP uses ADO (ActiveX Data Objects) technology to connect and work with databases.ASP.NET uses ADO.NET to connect and work with databases.
ASP is partially object-oriented.ASP.NET is fully object-oriented.
In ASP there is no facility to separate design from programming logic. In ASP.NET it has the option of Code Containment.
ASP Pages have the file extension .asp.ASP.NET Pages have the file extension .aspx.
ASP doesn’t have the concept of inheritance.ASP.NET inherit the class written in code behind.
ASP pages use scripting language.ASP.NET uses full-fledged programming language.
Error handling is very poor in ASP.Error handling is very good in ASP.NET.
In ASP debugging is difficult because the ASP scripts are interpreted. In ASP.NET debugging is easy.
ASP is not a configurable language. In ASP.NET Web.config is used for configuration.
ASP has maximum four in-built classes i.e. Request, Response, Session and Application.ASP.NET has more than 2000 in-built classes.