Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    London
    Posts
    341

    Question Unanswered: Whats the best way to write ASP pages

    Hi,

    I'm new to ASP and some of the pages I've written before have simply been copies and modifications to pages previously written for different purposes. Which all work fine, however I've recently bought MS Visual Web Developer so that I could write my pages from scratch but the whole page is designed differently... I just wondered what was the best way to write these pages?

    This is going to be quite long so I apologise. For example, using visual web my page looks like this:


    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

    <!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">
    <link href="Style.css" rel="stylesheet" type="text/css" />
    <title>Learning and Development</title>
    </head>
    <body>

    <form id="form1" runat="server">

    <aspqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:CourseEvaluations_BeConnectionSt ring %>"
    ProviderName="<%$ ConnectionStrings:CourseEvaluations_BeConnectionSt ring.ProviderName %>"

    DeleteCommand="..."
    SelectCommand="..."

    <DeleteParameters>
    <asp:Parameter Name="EventID" Type="Int32" />
    </DeleteParameters>

    <UpdateParameters>
    <asp:Parameter Name="CourseDate" Type="DateTime" />
    <asp:Parameter Name="CourseID" Type="Int32" />
    <asp:Parameter Name="VenueID" Type="Int32" />
    <asp:Parameter Name="CourseAttending" Type="Double" />
    <asp:Parameter Name="EventID" Type="Int32" />
    </UpdateParameters>



    Where as, using the previous written pages, it looks like this;


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0;"
    conn.Open(Server.MapPath(".") & "\CourseEvaluations_Be.mdb")
    nItemsPerPage = 15
    %>

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Event List</title>
    <link rel="stylesheet" type="text/css" href="style.css">

    <body>

    <%
    sql="..."

    set rs = Server.CreateObject("ADODB.recordset")
    rs.CursorLocation = 3
    rs.Open sql, conn

    If rs.eof Then
    response.Write("No course records in database.")
    rs.close
    conn.close
    response.End
    End If
    %>

    <% response.Write(rs.fields("CourseAttending")) %>
    <% response.Write(rs.fields("CountOfEventID")) %>

    <%
    rs.movenext
    loop
    %>



    Sorry if this is confusing.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Welcome to the leap between classic ASP and ASP.NET!

    Your question (if we can call it that) is verrry open-ended; if you can be more specific, we can be more specific in our responses!

    You may wish to take a look at the following website for some mroe information http://www.w3schools.com/aspnet/
    George
    Home | Blog

  3. #3
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Actually you answered me really. I didn't know what the difference between the two were but if one is ASP and one is ASP.NET then I can look to understand more.

    Cheers george.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •