dear members of daniweb
i m new to asp.net
can u help me
my first querry is what is the difference between ASP and ASP.NET

Recommended Answers

All 6 Replies

Night and day. The differences can easily fill a chapter of a book, but here is a high level summary of some of the differences.

ASP, like PHP, mixes both HTML code and ASP code on the same page. ASP can uses VBScript (but can also use JavaScript) to execute code. You will generally see ASP code written sequentially. It begins at the top and executes down to the end. You can use functions, sub-routines, classes and other objects, but it is not object oriented.

Here is an example of code of an ASP page. You'll notice that ASP code is within the <% and %> tags.

<!DOCTYPE html>
<html>
<head>
    <title>My ASP Page</title>
</head>
<body>

<% 
Dim oConn, oRS, ds, sql, oCmd, qs
ds = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\inetpub\wwwroot\test.mdb;Persist Security Info=False;"
sql = "SELECT * FROM Employees where empID = ?"
qs = request.QueryString("qs")

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open ds

Set oCmd = Server.CreateObject("ADODB.Command") 
oCmd.ActiveConnection = oConn
oCmd.CommandText = sql
oCmd.CommandType = 1
oCmd.Prepared = True
oCmd.Parameters(0) = qs

Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open oCmd

do until oRS.EOF
  for each x in oRS.Fields
    Response.Write(x.name & "=" & x.value & "<br />")
  next
  Response.Write("<br />")
  oRS.MoveNext
loop
oRS.close
oConn.close
Set oRS=nothing
Set oConn=nothing

%>
</body>
</html>

ASP.NET is object oriented, uses the event-driven model, where all your code executes in response to an event, such as a "Page Load", "Button Click", etc. You can use many different languages to write your code: Visual Basic, C#, J#, etc. All code is compiled to use the same Common Language Runtime (CLR) that resides in the .NET Framework. Very similar to the concept in Java. Variables are strongly typed, and the same scoping rules that apply in any recent, major programming language.

Here is a very simple example of an asp.net page written in VB.NET which simple takes information from the Server Variables collection and during the page load event, assigns that information to a label control.

<%@ Page Language="VB" %>

<!DOCTYPE html>
<script runat="server">
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        lblIP.Text = Request.ServerVariables("remote_addr")
        Page.Title = "My Page"
    End Sub
</script>

<html>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label id="lblIP" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>

There is no requirement to learn ASP before you learn ASP.NET. You should pick up some books on ASP.NET, and download Visual Studio from the Micorosft site and start practicing.

As per the ASP and ASP.net difference concern i like to say that ASP is an interpreted programming language and ASP.net is compiled programming language. ASP use the technology called ADO where ASP.net use the ADO.net technology. ASP is the partially object oriented programming language where the ASP.net is the purely object oriented programming language.

The main difference between the ASP and ASP.net is that ASP uses interpreted VBScript or JScript and ASP.net uses any .Net language (C#,J#,VB.Net, etc)Compiled.

.NET is a development framework that contains many modules to help writing Web Applications and Windows Applications.

ASP is Microsoft's markup language for developing websites.

ASP.NET is Microsoft's technology to build Web Applications.

Then there is .NET 1.1, .NET 2.0, .NET 3.0 as new features and modules get added to the base framework.

http://www.aspwebhosting.com.au/

In classic ASP there was no server controls. You have to write all html tags manually. ASP.NET offers a very rich set of controls called Server Controls and Html Controls. It is very easy to drag and drop any controls to a web form. The VS.NET will automatically write the required HTML tags automatically for you.

A very simple answer: Classic ASP is a scripting language and ASP.Net is a Compliled language. It all looks the same to the browser.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.