Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: links in asp


Message #1 by nusrat sarwar <nusratsarwar@y...> on Mon, 25 Feb 2002 11:03:37 -0800 (PST)
Hi all

hope all of you are well and fine

this time I have problem in showing links in a

datalist 



if I am showing data list of items from a table

i.e  ID , Item, Location



I wanna make ID of each item a link so that  when a

user click the ID new page open up showing

description/ detail of that perticuler ietm

(hope I described it well)

please I'll be grateful if anyone tell me how I could

do it

more happy if given an example

 please do let me know as soon as possible as its very

urgent and important

many many thanx in advance and sorry for botheration



take care

regards

nusrat









__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com

Message #2 by "Anupama Nallari" <ANallari@p...> on Mon, 25 Feb 2002 13:15:15 -0600

Hi Nusrat,



This is how you do it.

In this example I use the Id field to link to another page where I 

display the details pertaining to that Id.

<td>

<a class=3D"c" 

href=3D"changereq.asp?id=3D<%=3Drstsupport.Fields("ID")%>"><font 

color=3Dblue face=3Darial size=3D2><%=3Drstsupport.Fields("ID")%></font>

</td>





I hope that helps.



Anu







-----Original Message-----

From: nusrat sarwar [mailto:nusratsarwar@y...]

Sent: Monday, February 25, 2002 1:04 PM

To: ASP Web HowTo

Subject: [asp_web_howto] links in asp





Hi all

hope all of you are well and fine

this time I have problem in showing links in a

datalist



if I am showing data list of items from a table

i.e  ID , Item, Location



I wanna make ID of each item a link so that  when a

user click the ID new page open up showing

description/ detail of that perticuler ietm

(hope I described it well)

please I'll be grateful if anyone tell me how I could

do it

more happy if given an example

 please do let me know as soon as possible as its very

urgent and important

many many thanx in advance and sorry for botheration



take care

regards

nusrat









__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com






$subst('Email.Unsub').

Message #3 by nusrat sarwar <nusratsarwar@y...> on Mon, 25 Feb 2002 11:26:47 -0800 (PST)
Hi Anupama Nallari 



Many thanx, MERCI, for prompt resopnse, Anu

I'll try it out

take care

regards

nusrat







__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com

Message #4 by "Drew, Ron" <RDrew@B...> on Mon, 25 Feb 2002 17:56:53 -0500
Ask and you shall receive...an example of movie selection....

<%

response.buffer=3Dtrue

Response.ExpiresAbsolute =3D Now() - 1

Response.AddHeader "Cache-Control", "private"

%>

<%

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Gets the Parameters from Form

Dim strname, strgenre, strrating

   strname =3D Request.Form("name")

   strgenre =3D Request.Form("genre")

   strrating =3D Request.Form("rating")

   Response.Write "<b>Parameters:&nbsp;&nbsp;</b>"

   Response.Write "<b>Movie Name>&nbsp;&nbsp</b>"

   Response.Write strname

   Response.Write "<b>&nbsp;&nbsp&nbsp;&nbspGenre>&nbsp;&nbsp</b>"

   Response.Write strgenre

   Response.Write "<b>&nbsp;&nbsp&nbsp;&nbspRating>&nbsp;&nbsp</b>"

   Response.Write strrating

   Response.Write "<br>"

%>

<html><head>

<title>Movie Search View</title>

<meta http-equiv=3D"pragma" content=3D"no-cache">

</head>

<body bgcolor=3D"#FFFFFF" text=3D"#3B813B" link=3D"#E1CF45" 

vlink=3D"#D34433"

alink=3D"#3B813B">

<center>

  <p><strong><font size=3D"5">Will's Movie Search

Results</font></strong></p>

  <p align=3D"left">

    <%

mySQL =3D "select VideoCollectionID, MovieTitle, Genre, Rating "

     mySQL =3D mySQL & "from dvds "

     mySQL =3D mySQL & "where Genre =3D '" & strgenre & "'"

	 if not strname =3D "" then

	   mySQL =3D mySQL & " AND MovieTitle LIKE '%" & strname & "%'"

	 end if

	 if not strrating =3D "" then

	   mySQL =3D mySQL & " AND Rating =3D '" & strrating & "';"

	 end if

' Response.Write mySQL

idfield=3D"VideoCollectionID"

scriptresponder=3D"viewmovies2.asp"

set conntemp=3Dserver.createobject("adodb.connection")

conntemp.open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _

            "Data Source=3DD:\InetPub\wwwroot\will\movies\dvds.mdb;" & _

            "User Id=3Dadmin;" & _

            "Password=3D;"

set rstemp=3Dconntemp.execute(mySQL)

howmanyfields=3Drstemp.fields.count -1

%>

  </p>

</center>

<table border=3D"1" width=3D"100%">

  <tr>

<td valign=3D"top">&nbsp;&nbsp;&nbsp;</td>

<% 'Put Headings On The Table of Field Names

for i=3D0 to howmanyfields %>

       <td align=3Dcenter><b><%=3Drstemp(i).name %></b></td>

<% next %>

</tr>

<% ' Now lets grab all the records

do  while not rstemp.eof %>

   <tr><td valign=3D"top">

   <%my_link=3Dscriptresponder & "?which=3D" & rstemp(idfield)%>

   <a HREF=3D"<%=3Dmy_link%>">View</a></td>

   <% for i =3D 0 to howmanyfields%>

          <td valign=3D"top"><%=3Drstemp(i)%></td>

   <% next %>

   </tr>

   <%

  rstemp.movenext

loop



rstemp.close

set rstemp=3Dnothing

conntemp.close

set conntemp=3Dnothing

%>

</table>

<div align=3D"left"><br>

</div>

<table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"5">

  <tr>

    <td>

      <div align=3D"center"> <button type=3D"button"

onClick=3D"javascript:history.go(-1);">Back

        to Movie Search</button> </div>

    </td>

  </tr>

</table>

</body>

</html>





-----Original Message-----

From: nusrat sarwar [mailto:nusratsarwar@y...]

Sent: Monday, February 25, 2002 2:04 PM

To: ASP Web HowTo

Subject: [asp_web_howto] links in asp





Hi all

hope all of you are well and fine

this time I have problem in showing links in a

datalist



if I am showing data list of items from a table

i.e  ID , Item, Location



I wanna make ID of each item a link so that  when a

user click the ID new page open up showing

description/ detail of that perticuler ietm

(hope I described it well)

please I'll be grateful if anyone tell me how I could

do it

more happy if given an example

 please do let me know as soon as possible as its very

urgent and important

many many thanx in advance and sorry for botheration



take care

regards

nusrat









__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com






$subst('Email.Unsub').

Message #5 by "Ken Schaefer" <ken@a...> on Tue, 26 Feb 2002 11:06:20 +1100
Here's (IMHO) a nicer way to write the same bit of code, that attempts to

separate the bus logic from the presentation. We keep the business logic up

the top, and we don't mix it in with the HTML stuff.



<%

Option Explicit

%>

<!-- #include virtual="/inc/Misc/isPostBack.asp" -->

<1--#include virtual="/inc/Misc/SafeForSQL.asp" -->

<1--#include virtual="/inc/Misc/ObjDispose.asp" -->

<1--#include virtual="/inc/Misc/DBConnOpen.asp" -->

<%

Dim strName    ' As string

Dim strGenre    ' As string

Dim strRating    ' As string

Dim strSQL        ' As string

Dim objConn      ' As ADODB.Connection

Dim arrResults    ' as Array

Dim i                ' as Int



If isPostBack() then



    strname = Request.Form("name")

    strgenre = Request.Form("genre")

    strrating = Request.Form("rating")



    strSQL = _

        "SELECT VideoCollectionID, MovieTitle, Genre, Rating " & _

        "FROM DVDs " & _

        "WHERE Genre = '" & SafeForSQL(strgenre) & "'"

        If strName <> "" then

            strSQL = strSQL & _

                " AND MovieTitle LIKE '%" & SafeForSQL(strname) & "%'"

        End If

        If strRating <> "" then

            strSQL = strSQL & _

                " AND Rating = '" & SafeForSQL(strRating) & "'"

        End If



        Call DBConnOpen(objConn, Application("SQLServerConnString")

        arrResults = ArrayFromSQL(objConn, strSQL)

        Call ObjDispose(objConn, True, True)



End If

%>



<html>

    <head>

        <title>Movie Search View</title>

    </head>

    <body>

        <p align="center">

            <strong><font size="5">Will's Movie Search

Results</font></strong>

        </p>



        <%

        If isArray(arrResults) then

        %>

        <table border="1" width="100%">

            <tr>

                <td><p>VideoCollectionID</p></td>

                <td><p>MovieTitle</p></td>

                <td><p>Genre</p></td>

                <td><p>Rating</p></td>

            </tr>



            <%

            For i = 0 to UBound(arrResults, 2)

            %>

            <tr>

                <td><p><a

href="viewmovies2.asp?which=<%=arrResults(0,i)%>">View</a></p</td>

                <td><p><%=arrResults(1,i)%></p</td>

                <td><p><%=arrResults(2,i)%></p</td>

                <td><p><%=arrResults(3,i)%></p</td>

            </tr>

            <% Next %>

        </table>

        <% Else %>

        <p>No results</p>

        <% End If %>

    </body>

</html>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Drew, Ron" <RDrew@B...>

Subject: [asp_web_howto] RE: links in asp





Ask and you shall receive...an example of movie selection....

<%

response.buffer=true

Response.ExpiresAbsolute = Now() - 1

Response.AddHeader "Cache-Control", "private"

%>

<%

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Gets the Parameters from Form

Dim strname, strgenre, strrating

   strname = Request.Form("name")

   strgenre = Request.Form("genre")

   strrating = Request.Form("rating")

   Response.Write "<b>Parameters:&nbsp;&nbsp;</b>"

   Response.Write "<b>Movie Name>&nbsp;&nbsp</b>"

   Response.Write strname

   Response.Write "<b>&nbsp;&nbsp&nbsp;&nbspGenre>&nbsp;&nbsp</b>"

   Response.Write strgenre

   Response.Write "<b>&nbsp;&nbsp&nbsp;&nbspRating>&nbsp;&nbsp</b>"

   Response.Write strrating

   Response.Write "<br>"

%>

<html><head>

<title>Movie Search View</title>

<meta http-equiv="pragma" content="no-cache">

</head>

<body bgcolor="#FFFFFF" text="#3B813B" link="#E1CF45" vlink="#D34433"

alink="#3B813B">

<center>

  <p><strong><font size="5">Will's Movie Search

Results</font></strong></p>

  <p align="left">

    <%

mySQL = "select VideoCollectionID, MovieTitle, Genre, Rating "

     mySQL = mySQL & "from dvds "

     mySQL = mySQL & "where Genre = '" & strgenre & "'"

if not strname = "" then

   mySQL = mySQL & " AND MovieTitle LIKE '%" & strname & "%'"

end if

if not strrating = "" then

   mySQL = mySQL & " AND Rating = '" & strrating & "';"

end if

' Response.Write mySQL

idfield="VideoCollectionID"

scriptresponder="viewmovies2.asp"

set conntemp=server.createobject("adodb.connection")

conntemp.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _

            "Data Source=D:\InetPub\wwwroot\will\movies\dvds.mdb;" & _

            "User Id=admin;" & _

            "Password=;"

set rstemp=conntemp.execute(mySQL)

howmanyfields=rstemp.fields.count -1

%>

  </p>

</center>

<table border="1" width="100%">

  <tr>

<td valign="top">&nbsp;&nbsp;&nbsp;</td>

<% 'Put Headings On The Table of Field Names

for i=0 to howmanyfields %>

       <td align=center><b><%=rstemp(i).name %></b></td>

<% next %>

</tr>

<% ' Now lets grab all the records

do  while not rstemp.eof %>

   <tr><td valign="top">

   <%my_link=scriptresponder & "?which=" & rstemp(idfield)%>

   <a HREF="<%=my_link%>">View</a></td>

   <% for i = 0 to howmanyfields%>

          <td valign="top"><%=rstemp(i)%></td>

   <% next %>

   </tr>

   <%

  rstemp.movenext

loop



rstemp.close

set rstemp=nothing

conntemp.close

set conntemp=nothing

%>

</table>

<div align="left"><br>

</div>

<table width="100%" border="0" cellspacing="0" cellpadding="5">

  <tr>

    <td>

      <div align="center"> <button type="button"

onClick="javascript:history.go(-1);">Back

        to Movie Search</button> </div>

    </td>

  </tr>

</table>

</body>

</html>





-----Original Message-----

From: nusrat sarwar [mailto:nusratsarwar@y...]

Sent: Monday, February 25, 2002 2:04 PM

To: ASP Web HowTo

Subject: [asp_web_howto] links in asp





Hi all

hope all of you are well and fine

this time I have problem in showing links in a

datalist



if I am showing data list of items from a table

i.e  ID , Item, Location



I wanna make ID of each item a link so that  when a

user click the ID new page open up showing

description/ detail of that perticuler ietm

(hope I described it well)

please I'll be grateful if anyone tell me how I could

do it

more happy if given an example

 please do let me know as soon as possible as its very

urgent and important

many many thanx in advance and sorry for botheration



take care

regards

nusrat









__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com






$subst('Email.Unsub').






$subst('Email.Unsub').



Message #6 by "Drew, Ron" <RDrew@B...> on Mon, 25 Feb 2002 20:06:10 -0500
Thanks Ken..I will give it a try..by the way what does IMHO stand for?

Cheers

Ron



-----Original Message-----

From: Ken Schaefer [mailto:ken@a...]

Sent: Monday, February 25, 2002 7:06 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: links in asp





Here's (IMHO) a nicer way to write the same bit of code, that attempts

to separate the bus logic from the presentation. We keep the business

logic up the top, and we don't mix it in with the HTML stuff.



<%

Option Explicit

%>

<!-- #include virtual=3D"/inc/Misc/isPostBack.asp" --> <1--#include

virtual=3D"/inc/Misc/SafeForSQL.asp" --> <1--#include

virtual=3D"/inc/Misc/ObjDispose.asp" --> <1--#include

virtual=3D"/inc/Misc/DBConnOpen.asp" --> <%

Dim strName    ' As string

Dim strGenre    ' As string

Dim strRating    ' As string

Dim strSQL        ' As string

Dim objConn      ' As ADODB.Connection

Dim arrResults    ' as Array

Dim i                ' as Int



If isPostBack() then



    strname =3D Request.Form("name")

    strgenre =3D Request.Form("genre")

    strrating =3D Request.Form("rating")



    strSQL =3D _

        "SELECT VideoCollectionID, MovieTitle, Genre, Rating " & _

        "FROM DVDs " & _

        "WHERE Genre =3D '" & SafeForSQL(strgenre) & "'"

        If strName <> "" then

            strSQL =3D strSQL & _

                " AND MovieTitle LIKE '%" & SafeForSQL(strname) & "%'"

        End If

        If strRating <> "" then

            strSQL =3D strSQL & _

                " AND Rating =3D '" & SafeForSQL(strRating) & "'"

        End If



        Call DBConnOpen(objConn, Application("SQLServerConnString")

        arrResults =3D ArrayFromSQL(objConn, strSQL)

        Call ObjDispose(objConn, True, True)



End If

%>



<html>

    <head>

        <title>Movie Search View</title>

    </head>

    <body>

        <p align=3D"center">

            <strong><font size=3D"5">Will's Movie Search

Results</font></strong>

        </p>



        <%

        If isArray(arrResults) then

        %>

        <table border=3D"1" width=3D"100%">

            <tr>

                <td><p>VideoCollectionID</p></td>

                <td><p>MovieTitle</p></td>

                <td><p>Genre</p></td>

                <td><p>Rating</p></td>

            </tr>



            <%

            For i =3D 0 to UBound(arrResults, 2)

            %>

            <tr>

                <td><p><a

href=3D"viewmovies2.asp?which=3D<%=3DarrResults(0,i)%>">View</a></p</td>

                <td><p><%=3DarrResults(1,i)%></p</td>

                <td><p><%=3DarrResults(2,i)%></p</td>

                <td><p><%=3DarrResults(3,i)%></p</td>

            </tr>

            <% Next %>

        </table>

        <% Else %>

        <p>No results</p>

        <% End If %>

    </body>

</html>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Drew, Ron" <RDrew@B...>

Subject: [asp_web_howto] RE: links in asp





Ask and you shall receive...an example of movie selection.... <%

response.buffer=3Dtrue Response.ExpiresAbsolute =3D Now() - 1

Response.AddHeader "Cache-Control", "private" %> <%

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Gets the Parameters from Form

Dim strname, strgenre, strrating

   strname =3D Request.Form("name")

   strgenre =3D Request.Form("genre")

   strrating =3D Request.Form("rating")

   Response.Write "<b>Parameters:&nbsp;&nbsp;</b>"

   Response.Write "<b>Movie Name>&nbsp;&nbsp</b>"

   Response.Write strname

   Response.Write "<b>&nbsp;&nbsp&nbsp;&nbspGenre>&nbsp;&nbsp</b>"

   Response.Write strgenre

   Response.Write "<b>&nbsp;&nbsp&nbsp;&nbspRating>&nbsp;&nbsp</b>"

   Response.Write strrating

   Response.Write "<br>"

%>

<html><head>

<title>Movie Search View</title>

<meta http-equiv=3D"pragma" content=3D"no-cache">

</head>

<body bgcolor=3D"#FFFFFF" text=3D"#3B813B" link=3D"#E1CF45" 

vlink=3D"#D34433"

alink=3D"#3B813B"> <center>

  <p><strong><font size=3D"5">Will's Movie Search

Results</font></strong></p>

  <p align=3D"left">

    <%

mySQL =3D "select VideoCollectionID, MovieTitle, Genre, Rating "

     mySQL =3D mySQL & "from dvds "

     mySQL =3D mySQL & "where Genre =3D '" & strgenre & "'"

if not strname =3D "" then

   mySQL =3D mySQL & " AND MovieTitle LIKE '%" & strname & "%'" end if 

if

not strrating =3D "" then

   mySQL =3D mySQL & " AND Rating =3D '" & strrating & "';"

end if

' Response.Write mySQL

idfield=3D"VideoCollectionID"

scriptresponder=3D"viewmovies2.asp"

set conntemp=3Dserver.createobject("adodb.connection")

conntemp.open "Provider=3DMicrosoft.Jet.OLEDB.4.0;" & _

            "Data Source=3DD:\InetPub\wwwroot\will\movies\dvds.mdb;" & _

            "User Id=3Dadmin;" & _

            "Password=3D;"

set rstemp=3Dconntemp.execute(mySQL) howmanyfields=3Drstemp.fields.count 

-1

%>

  </p>

</center>

<table border=3D"1" width=3D"100%">

  <tr>

<td valign=3D"top">&nbsp;&nbsp;&nbsp;</td>

<% 'Put Headings On The Table of Field Names

for i=3D0 to howmanyfields %>

       <td align=3Dcenter><b><%=3Drstemp(i).name %></b></td>

<% next %>

</tr>

<% ' Now lets grab all the records

do  while not rstemp.eof %>

   <tr><td valign=3D"top">

   <%my_link=3Dscriptresponder & "?which=3D" & rstemp(idfield)%>

   <a HREF=3D"<%=3Dmy_link%>">View</a></td>

   <% for i =3D 0 to howmanyfields%>

          <td valign=3D"top"><%=3Drstemp(i)%></td>

   <% next %>

   </tr>

   <%

  rstemp.movenext

loop



rstemp.close

set rstemp=3Dnothing

conntemp.close

set conntemp=3Dnothing

%>

</table>

<div align=3D"left"><br>

</div>

<table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"5">

  <tr>

    <td>

      <div align=3D"center"> <button type=3D"button"

onClick=3D"javascript:history.go(-1);">Back

        to Movie Search</button> </div>

    </td>

  </tr>

</table>

</body>

</html>





-----Original Message-----

From: nusrat sarwar [mailto:nusratsarwar@y...]

Sent: Monday, February 25, 2002 2:04 PM

To: ASP Web HowTo

Subject: [asp_web_howto] links in asp





Hi all

hope all of you are well and fine

this time I have problem in showing links in a

datalist



if I am showing data list of items from a table

i.e  ID , Item, Location



I wanna make ID of each item a link so that  when a

user click the ID new page open up showing

description/ detail of that perticuler ietm

(hope I described it well)

please I'll be grateful if anyone tell me how I could

do it

more happy if given an example

 please do let me know as soon as possible as its very

urgent and important

many many thanx in advance and sorry for botheration



take care

regards

nusrat









__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com



---

Change your mail options at http://p2p.wrox.com/manager.asp or to

unsubscribe send a blank email to

$subst('Email.Unsub').



---

Change your mail options at http://p2p.wrox.com/manager.asp or to

unsubscribe send a blank email to

$subst('Email.Unsub').








$subst('Email.Unsub').

Message #7 by "Ken Schaefer" <ken@a...> on Tue, 26 Feb 2002 13:39:01 +1100
In my honest opinion



(obviously you're going to have to tweak the code to fit your exact server

setup, but you can see the idea that we put all the ASP code, like getting

stuff out of the database etc together at the top, and all the HTML stuff at

the bottom)



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Drew, Ron" <RDrew@B...>

Subject: [asp_web_howto] RE: links in asp





Thanks Ken..I will give it a try..by the way what does IMHO stand for?

Cheers

Ron



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Message #8 by "Drew, Ron" <RDrew@B...> on Tue, 26 Feb 2002 07:43:13 -0500
Thanks again.

Ron



-----Original Message-----

From: Ken Schaefer [mailto:ken@a...]

Sent: Monday, February 25, 2002 9:39 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: links in asp





In my honest opinion



(obviously you're going to have to tweak the code to fit your exact

server setup, but you can see the idea that we put all the ASP code,

like getting stuff out of the database etc together at the top, and all

the HTML stuff at the bottom)



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Drew, Ron" <RDrew@B...>

Subject: [asp_web_howto] RE: links in asp





Thanks Ken..I will give it a try..by the way what does IMHO stand for?

Cheers Ron



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~








$subst('Email.Unsub').

Message #9 by nusrat sarwar <nusratsarwar@y...> on Tue, 26 Feb 2002 06:40:28 -0800 (PST)
Hi there

thanx Ron 

I am already grateful for yr previous help which is

perfect in action

I'll try this one as well and sure that it will work

fine

I tried Anu's code which was also good, thanx to Anu

take good care of yrself and keep helping this pest

regards

nusrat



--- "Drew, Ron" <RDrew@B...> wrote:

> Ask and you shall receive...an example of movie

> selection....

> <%

> response.buffer=true

> Response.ExpiresAbsolute = Now() - 1

> Response.AddHeader "Cache-Control", "private"

> %>

> <%

>

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

> 'Gets the Parameters from Form

> Dim strname, strgenre, strrating

>    strname = Request.Form("name")

>    strgenre = Request.Form("genre")

>    strrating = Request.Form("rating")

>    Response.Write "<b>Parameters:&nbsp;&nbsp;</b>"

>    Response.Write "<b>Movie Name>&nbsp;&nbsp</b>"

>    Response.Write strname

>    Response.Write

> "<b>&nbsp;&nbsp&nbsp;&nbspGenre>&nbsp;&nbsp</b>"

>    Response.Write strgenre

>    Response.Write

> "<b>&nbsp;&nbsp&nbsp;&nbspRating>&nbsp;&nbsp</b>"

>    Response.Write strrating

>    Response.Write "<br>"

> %>

> <html><head>

> <title>Movie Search View</title>

> <meta http-equiv="pragma" content="no-cache">

> </head>

> <body bgcolor="#FFFFFF" text="#3B813B"

> link="#E1CF45" vlink="#D34433"

> alink="#3B813B">

> <center>

>   <p><strong><font size="5">Will's Movie Search

> Results</font></strong></p>

>   <p align="left"> 

>     <%

> mySQL = "select VideoCollectionID, MovieTitle,

> Genre, Rating "

>      mySQL = mySQL & "from dvds "

>      mySQL = mySQL & "where Genre = '" & strgenre &

> "'" 

> 	 if not strname = "" then

> 	   mySQL = mySQL & " AND MovieTitle LIKE '%" &

> strname & "%'"

> 	 end if

> 	 if not strrating = "" then

> 	   mySQL = mySQL & " AND Rating = '" & strrating &

> "';"

> 	 end if

> ' Response.Write mySQL

> idfield="VideoCollectionID"

> scriptresponder="viewmovies2.asp"

> set conntemp=server.createobject("adodb.connection")

> conntemp.open "Provider=Microsoft.Jet.OLEDB.4.0;" &

> _

>             "Data

> Source=D:\InetPub\wwwroot\will\movies\dvds.mdb;" & _

>             "User Id=admin;" & _

>             "Password=;" 

> set rstemp=conntemp.execute(mySQL)

> howmanyfields=rstemp.fields.count -1

> %>

>   </p>

> </center>

> <table border="1" width="100%">

>   <tr>

> <td valign="top">&nbsp;&nbsp;&nbsp;</td>

> <% 'Put Headings On The Table of Field Names

> for i=0 to howmanyfields %>

>        <td align=center><b><%=rstemp(i).name

> %></b></td>

> <% next %>

> </tr>

> <% ' Now lets grab all the records

> do  while not rstemp.eof %>

>    <tr><td valign="top">

>    <%my_link=scriptresponder & "?which=" &

> rstemp(idfield)%>

>    <a HREF="<%=my_link%>">View</a></td>

>    <% for i = 0 to howmanyfields%>

>           <td valign="top"><%=rstemp(i)%></td>

>    <% next %>

>    </tr>

>    <%

>   rstemp.movenext

> loop

> 

> rstemp.close

> set rstemp=nothing

> conntemp.close

> set conntemp=nothing

> %>

> </table>

> <div align="left"><br>

> </div>

> <table width="100%" border="0" cellspacing="0"

> cellpadding="5">

>   <tr> 

>     <td> 

>       <div align="center"> <button type="button"

> onClick="javascript:history.go(-1);">Back 

>         to Movie Search</button> </div>

>     </td>

>   </tr>

> </table>

> </body>

> </html>

> 

> 

> -----Original Message-----

> From: nusrat sarwar [mailto:nusratsarwar@y...] 

> Sent: Monday, February 25, 2002 2:04 PM

> To: ASP Web HowTo

> Subject: [asp_web_howto] links in asp

> 

> 

> Hi all

> hope all of you are well and fine

> this time I have problem in showing links in a

> datalist 

> 

> if I am showing data list of items from a table

> i.e  ID , Item, Location

> 

> I wanna make ID of each item a link so that  when a

> user click the ID new page open up showing

> description/ detail of that perticuler ietm

> (hope I described it well)

> please I'll be grateful if anyone tell me how I

> could

> do it

> more happy if given an example

>  please do let me know as soon as possible as its

> very

> urgent and important

> many many thanx in advance and sorry for botheration

> 

> take care

> regards

> nusrat

> 

> 

> 

> 

> __________________________________________________

> Do You Yahoo!?

> Yahoo! Sports - Coverage of the 2002 Olympic Games

> http://sports.yahoo.com

> 





> $subst('Email.Unsub').

> 





$subst('Email.Unsub').





__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com

Message #10 by nusrat sarwar <nusratsarwar@y...> on Tue, 26 Feb 2002 06:43:01 -0800 (PST)
Hello  Ken Schaefer 

I am glad you respond to my query, I am honoured

(but actually u respond to Ron )

any way many many thanx

take care

regards

nusrat 





__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com

Message #11 by nusrat sarwar <nusratsarwar@y...> on Tue, 26 Feb 2002 06:57:32 -0800 (PST)
Ken you include 4 files

how can I run it(code) without them??

thanx

take care 

regards

nusrat



__________________________________________________

Do You Yahoo!?

Yahoo! Sports - Coverage of the 2002 Olympic Games

http://sports.yahoo.com

Message #12 by "Ken Schaefer" <ken@a...> on Wed, 27 Feb 2002 12:47:22 +1100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "nusrat sarwar" <nusratsarwar@y...>

Subject: [asp_web_howto] RE: links in asp





: Ken you include 4 files

: how can I run it(code) without them??

: thanx

: take care



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



They are simple routines - you should be able to work out what they do from

their names...

Some of them are at: www.adopenstatic.com/resources/code/



eg ArrayFromSQL and ObjDispose:



<%

'--------------------------------------------------

' Accepts objConn as ADODB.Connection

' Accepts strSQL as string

' Returns Array

'--------------------------------------------------

Function ArrayFromSQL( _

    ByRef objConn, _

    ByVal strSQL _

    )



    Dim objRS

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

    objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText



    If not objRS.EOF then

        ArrayFromSQL = objRS.GetRows

    End If



    Call objDispose(objRS, True, True)



End Function



Sub ObjDispose( _

    ByRef objToDispose, _

    ByVal blnCloseObject, _

    ByVal blnSetNothing _

    )



    If blnCloseObject then

        objToDispose.Close

    End If



    If blnSetNothing then

        Set objToDispose = Nothing

    End If



End Sub

%>





Cheers

Ken




  Return to Index