Please check the following asp file in the localhost just for demo. Due to connect (data) problem it will not show the data (list).
I want that I select the option, it will redirect to that page.
What logic / coding will apply. Please inform.
firstfile.asp condition.asp contractno.asp recordno.asp category.asp
If I select contractno option, it redirect to contractno.asp
If I select recordno option it redirect to recordno.asp
If I select category option it redirect to category.asp
================================================== =======
First page
<html>
</HEAD>
<body>
<form method=post action=search2.asp id=form name=form>
<INPUT style="WIDTH: 48px; HEIGHT: 24px" type=submit size=16 value=search id=submit1 name=submit1><INPUT style="WIDTH: 48px; HEIGHT: 24px" type=reset size=16 value=clear id=submit1 name=submit1>
<TABLE cellSpacing=1 cellPadding=1 width="680" border=1 bordercolorlight="#CCCCCC" bordercolordark="#666666">
<TR>
<TD width="231">Contract No :</TD>
<TD width="333"><SELECT id=contractno name=contractno> <OPTION selected>
<%
dim ssql
set cn=server.CreateObject("adodb.connection")
cn.ConnectionString="Provider=SQLOLEDB.1;Integrate d Security=SSPI;Persist Security Info=False;Initial Catalog=dcil;Data Source=AUHTRIPSVR2"
cn.Open
contractno=Request.QueryString("contractno")
ssql="select distinct contractno from archive2 order by contractno"
set rs=cn.Execute(ssql)
do while rs.eof=false
Response.Write("<option value='" & rs("contractno") & "'>")
Response.Write(rs("contractno") )
rs.movenext
loop
%>
</OPTION></SELECT></TD></TR>
<TR>
<TD width="231">Record Drawing No :</TD>
<TD width="333"><SELECT id=recordno name=recordno><OPTION selected>
<%
set cn=server.CreateObject("adodb.connection")
cn.ConnectionString="Provider=SQLOLEDB.1;Integrate d Security=SSPI;Persist Security Info=False;Initial Catalog=dcil;Data Source=AUHTRIPSVR2"
cn.Open
ssql="select distinct recordno from archive2 order by recordno"
set rs=cn.Execute(ssql)
do while rs.eof=false
Response.Write("<option value='" & rs("recordno") & "'>")
Response.Write(rs("recordno") )
rs.movenext
loop
%>
</OPTION></SELECT></TD></TR>
<TR>
<TD width="231">Drawings Category :</TD>
<TD width="333"><SELECT id=category name=category> <OPTION
selected>
<%
ssql="select distinct category from archive2 order by category"
set rs=cn.Execute(ssql)
do while rs.eof=false
Response.Write("<option value='" & rs("category") & "'>")
Response.Write(rs("category") )
rs.movenext
loop
%>
</OPTION></SELECT></TD></TR>
<TR>
</TD></TR></TABLE>
</P>
</form>
</BODY>
</HTML><body background="images/radbkgnd.gif" bgcolor="#FFFFFF" text="#000000" link="#6666FF" vlink="#993333" alink="#66CCCC"></body>
================================================== =====================
second page
what condition / coding will use to redirect the next page, the value which was selected from firstpage, please send.
.....
............
================================================== =======================
third page
get the value from the second page, and display the result. as need.
<html>
<HEAD>
</HEAD>
<BODY>
<form method=post action=wpls.asp id=form name=form>
<%
set cn=server.CreateObject("adodb.connection")
cn.ConnectionString="Provider=SQLOLEDB.1;Integrate d Security=SSPI;Persist Security Info=False;Initial Catalog=dcil;Data Source=AUHTRIPSVR2"
cn.Open
contractno=Request.QueryString("contractno")
contractno=Request.Form("contractno")
recordid=Request.Form("recordid")
if rs="" then
rs="-"
end if
ssql="SELECT * FROM archive2 where contractno='" &contractno & "'"
'Record Set
set rs=cn.Execute(ssql)
%>
<TABLE border=1 bordercolorlight="#669999" bordercolordark="#330066">
<tr bgcolor=gold>
<th>Contract No</th>
<th>Record Drawing No</th>
<th>Description</th>
<th>Drawing Category</th>
<th>Contractor</th>
<th>Consultant</th>
<th>Drawing No</th>
<th>ImageReference</th>
<th>Window_x1</th>
<th>Window_y1</th>
<th>Window_x2</th>
<th>Window_y2</th>
</tr>
<%
do while NOT rs.EOF
Response.Write("<tr>")
Response.Write("<td bgcolor=lightyellow>" & rs("contractno") & "</td>")
Response.Write("<td>" & rs("recordno") & "</td>")
Response.Write("<td>" & rs("description") & "</td>")
Response.Write("<td>" & rs("category") & "</td>")
Response.Write("<td>" & rs("contractor") & "</td>")
Response.Write("<td>" & rs("consultant") & "</td>")
Response.Write("<td>" & rs("drawingno") & "</td>")
Response.Write("<td>")
Response.Write("<a href=" & server.URLEncode(rs("imagereference")) & ">" & rs("imagereference") & "</a>")
Response.Write("</td>")
Response.Write("<td>" & rs("window_x1") & "</td>")
Response.Write("<td>" & rs("window_y1") & "</td>")
Response.Write("<td>" & rs("window_x2") & "</td>")
Response.Write("<td>" & rs("window_y2") & "</td>")
Response.Write("<tr>")
rs.movenext
loop
%>
</TABLE>
<INPUT id=submit2 name=submit2 type=submit value="Back" target=Right>
</P>
<P> </P>
</BODY>
</HTML>
</body>
Quote:
quote:Originally posted by NotNowJohn
For the transfer variable's value to the dest page try this:
Response.Redirect("contno.asp?contractno=" & contractno)
add a sign equal "=" after the variable name in the query string.
Regards.
Mateen Martin
...but the Soon is eclipsed by the Moon
|