QueryString asp to asp.net

P

Patrick.O.Ige

I have 2 asp files below:-
The first one displays OFFERS with the ServID and ServiceName (whcih is the
LINKS)-services.asp
The second one displays the data where servid = querystringID -offer.asp
Whats the best way to change these FILES to ASP.NET and how
Thanks

services.asp
--------------
Dim Conn
Dim rsCat
Dim strSQL

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("..\db\business.mdb")

Set rsCat = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT * FROM services1"
Set rsCat = Conn.Execute(strSQL)

%>
<%
Do While Not rsCat.EOF
Response.Write "<img src='form_handler.gif'><a
href=""offers.asp?catID=" & rsCat("ServID") & """>" & rsCat("ServiceName") &
"</a><br><br>"
rsCat.Movenext
Loop
%>

<%
rsCat.Close
Conn.Close
%>

--------------------------------------------------------------------
OFFERS.asp

<%
Dim Conn
Dim rsProd
Dim strSQL
Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("..\db\business.mdb")

Set rsProd = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM offers " & "WHERE ServID = " &
Request.QueryString("catID") & " " & "ORDER BY Description"
Set rsProd = Conn.Execute(strSQL)
%>
<body>

<ul>
<%
Do While Not rsProd.EOF
Response.Write rsProd("Description")


rsProd.Movenext
Loop
%>

<%
rsProd.Close
Conn.Close
%>
 
G

Guest

Open QuickStart tutorial, there you can find exact guide of simple port ASP
to ASP.Net.

In simple words, just rename .asp to .aspx, correct their syntax and this is
all.
Do not forget to set compatibility mode in the beginning of files like this:

<%@ Page Language="vb" AspCompat=True %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top