If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Whats the best way to write ASP pages

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-28-08, 07:40
christyxo christyxo is offline
Registered User
 
Join Date: Oct 2003
Location: London
Posts: 291
Question 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.
Reply With Quote
  #2 (permalink)  
Old 03-28-08, 07:50
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
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
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 03-31-08, 05:52
christyxo christyxo is offline
Registered User
 
Join Date: Oct 2003
Location: London
Posts: 291
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On