New to using ASP

Discussion in 'ASP General' started by apgoodb, Apr 19, 2004.

  1. apgoodb

    apgoodb Guest

    I think this should be quite easy; however, I am having problems. I
    want to build a page that takes information from an SQL query and puts
    the names in a list box. From this box the user can select which
    "Market" they wish to use and then they can select one of a few links
    to different reports. These reports however, filter on which "Market"
    they selected. My problem is I don't know how to store the Market
    value in the session. Here is the code I have so far. Any help would
    be appreciated.
    Thanks,

    <%@ LANGUAGE="VBSCRIPT" %>
    <% Option Explicit %>
    <!--#include virtual="/checkit/Functions.asp"-->
    <%
    If Session("UserName")="" Then
    Response.Redirect("log_in.asp")
    ElseIf Session("Client")="" Then
    Response.Redirect("client_list.asp")
    End If

    %>


    <html>
    <head>
    <title>Untitled Document</title>
    </head> <body bgcolor="#FFFFFF">

    <body bgcolor="#FFFFFF">
    <table width="100%" border="0">
    <tr>
    <td width="15%">&nbsp;</td>
    <td width="30%">&nbsp;</td>
    <td width="10%">&nbsp;</td>
    <td width="30%">&nbsp;</td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="15%">&nbsp;</td>
    <td bgcolor="#99CCCC" width="30%"
    background="green_fade.gif"><b>Available
    Markets:</b></td>
    <td width="10%">&nbsp;</td>
    <td width="30%" background="green_fade.gif"><b>Reports:</b></td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="15%" rowspan="7">&nbsp;</td>
    <td width="30%" rowspan="7">
    <form method="POST" action="markets.asp" name="frmSelectMarket">
    <select name="lstMarket" size="10">
    <%
    'set up query and display values
    Dim conn, mySurveyList, rs, sql
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open Session("ConnectionString")

    sql = "SELECT [market_master].[market_id],
    [market_master].[market_name] FROM ([market_master] INNER JOIN
    [evaluator] ON [market_master].[evaluator_id] =
    [evaluator].[evaluator_id]) WHERE [evaluator].[evaluator_id]='" &
    SQLString(Session("Client")) & "';"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
    Do Until rs.EOF %>
    <option value="<%=Server.HTMLEncode(rs.Fields("market_id").Value)%>"><%=Server.HTMLEncode(rs.Fields("market_name").Value)%></option>
    <%rs.MoveNext
    Loop

    rs.close
    set rs=Nothing
    conn.close
    set conn=nothing
    %>
    'link to reports
    </select>
    </form>
    </td>
    <td width="10%">&nbsp;</td>
    <td width="30%"><name="submit"><a href="overall.asp">Overall
    Performance</a></td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <td width="30%"><a href="financial.asp">Financial
    Stability</a></td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <td width="30%"><a href="health.asp">Health and Wellness</a></td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <td width="30%"><a href="satisfaction.asp">Satisfaction and
    Access</a> </td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <td width="30%"><a href="utilization.asp">Utilization</a></td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <td width="30%"><a href="utilization.asp">Maps</a></td>
    <td width="15%">&nbsp;</td>
    </tr>
    <tr>
    <td width="10%">&nbsp;</td>
    <td width="30%">&nbsp;</td>
    <td width="15%">&nbsp;</td>
    </tr>
    </table>
    <p>&nbsp;</p>
    </body>
    </html>
    apgoodb, Apr 19, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Tm92aWNl?=
    Replies:
    2
    Views:
    6,619
    Alan Ferrandiz Langley
    Jun 9, 2004
  2. Replies:
    3
    Views:
    453
    Mark Rae
    Jun 2, 2007
  3. Weston
    Replies:
    1
    Views:
    116
    Weston
    Aug 10, 2007
  4. Replies:
    4
    Views:
    133
    Thomas 'PointedEars' Lahn
    Dec 23, 2007
  5. Replies:
    2
    Views:
    439
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page