Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Search page

    Hi,

    i am developing a search page, basically using datagrid.
    i have given a column as hyperlink so that when the user clicks on it, it
    gives the details of the selected item in a seperate page.

    But i want to add a feature so that it saves the search results. for example
    even after seeing an item the user should be able to still view the search
    results so that he may view another item.

    i am finding it hard to develop such an application. so i am looking forward
    for some ideas and if possible some examples so that i get a fair idea as
    how to implemet it.
    any help in this regard would be highly appreciated.

    thanks,

    -sriram


    Sriram Guest

  2. Similar Questions and Discussions

    1. Search page question
      Hi, all: I am having problems with part of a search page. I am creating a search form with a search page and results page. The page that creates...
    2. Help with a search form/page
      need help with a search form i've been asked to do for a friend. i've done forms in the past, but not one like this. there will be 2 pick lists on...
    3. Prevent 'Page has expired' when a client hits back to return to a search page
      I have a search page that I want to enable private caching so that when a user hits the back button they dont get the page has expired error. I...
    4. Need help with PHP search page
      I am attempting to create a search page and a results page for my site. When I view the search page in the browser and run a search the results page...
    5. Warning Page Has Expired, I need to turn it OFF for a simple search page
      You can't turn it off. If you understand the reason for it, then you know that the Back button or Refresh button of a browser makes a new request...
  3. #2

    Default Re: Search page

    Hi Sriram,

    I think the easiest method would be to set up the links in your DataGrid so
    they open in a new window. That way, when the user clicks on a search
    result, they will see it in a new browser window, keeping the original
    window with the search results unchanged.

    Good luck!


    --
    Ray Dixon - Microsoft MVP
    [email]ray@NOSPAM.greeble.com[/email]
    (remove NOSPAM. from my e-mail address for a direct reply)


    "Sriram" <wvusriram@hotmail.com> wrote in message
    news:uWb9A9bXDHA.1480@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > i am developing a search page, basically using datagrid.
    > i have given a column as hyperlink so that when the user clicks on it, it
    > gives the details of the selected item in a seperate page.
    >
    > But i want to add a feature so that it saves the search results. for
    example
    > even after seeing an item the user should be able to still view the search
    > results so that he may view another item.
    >
    > i am finding it hard to develop such an application. so i am looking
    forward
    > for some ideas and if possible some examples so that i get a fair idea as
    > how to implemet it.
    > any help in this regard would be highly appreciated.
    >
    > thanks,
    >
    > -sriram
    >
    >

    Ray Dixon [MVP] Guest

  4. #3

    Default Re: Search page

    Sriram,

    Another choice, if your links are for data on your own site, would be to
    display the link item in a user control and place that control above or
    below the original search.

    That way the search results would still be available to the user. I'm doing
    something similar with my code library. I have a datagrid of each of the
    entries which displays five entry titles at a time. When a user clicks the
    link for one of the entries the entry is displayed below the grid. Keeping
    the datagrid limited to five entries keeps the entry display above the fold
    so the user sees it immediately.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche


    "Ray Dixon [MVP]" <ray@NOSPAM.greeble.com> wrote in message
    news:uj1ehOcXDHA.2476@tk2msftngp13.phx.gbl...
    > Hi Sriram,
    >
    > I think the easiest method would be to set up the links in your DataGrid
    so
    > they open in a new window. That way, when the user clicks on a search
    > result, they will see it in a new browser window, keeping the original
    > window with the search results unchanged.
    >
    > Good luck!
    >
    >
    > --
    > Ray Dixon - Microsoft MVP
    > [email]ray@NOSPAM.greeble.com[/email]
    > (remove NOSPAM. from my e-mail address for a direct reply)
    >
    >
    > "Sriram" <wvusriram@hotmail.com> wrote in message
    > news:uWb9A9bXDHA.1480@tk2msftngp13.phx.gbl...
    > > Hi,
    > >
    > > i am developing a search page, basically using datagrid.
    > > i have given a column as hyperlink so that when the user clicks on it,
    it
    > > gives the details of the selected item in a seperate page.
    > >
    > > But i want to add a feature so that it saves the search results. for
    > example
    > > even after seeing an item the user should be able to still view the
    search
    > > results so that he may view another item.
    > >
    > > i am finding it hard to develop such an application. so i am looking
    > forward
    > > for some ideas and if possible some examples so that i get a fair idea
    as
    > > how to implemet it.
    > > any help in this regard would be highly appreciated.
    > >
    > > thanks,
    > >
    > > -sriram
    > >
    > >
    >
    >

    S. Justin Gengo Guest

  5. #4

    Default Search Page

    I need to create a search form for Quote # and display the results based on
    that parameter.

    The problem is the data to display is based on an MS Access parent/child table
    with a one-to-many relationship.

    I currently have a connection established to the database using DSN.

    The parent table contains the information relating to a particular quote and
    the child table contains it's detail information.

    So, if I search for Quote # 241. The results would display the account
    number, customer name, etc. for that quote and within a repeating region
    section also display each item number, quanity, price, etc. quoted on that
    specific quote.

    I've found alot of information regarding Master/Detail pages and search pages.
    But haven't found anything which addresses this issue.

    Does anyone have an idea on how to accomplish this result?

    Thanks,

    skwilliams Guest

  6. #5

    Default Re: Search Page

    In the parent child relationship, there presumably is an associated field from
    each of the two tables that associates one to the other. In the SQL for the
    recordset, you could do a JOIN operation to bind the associated parent field to
    the associated child field, which should provide you with the correctly
    associated data from the two tables in your repeat region. Check this URL for
    more on JOINS: [url]http://www.techonthenet.com/sql/joins.htm[/url] HTH Bill

    Billium99 Guest

  7. #6

    Default Re: Search Page

    This is the SQL for my recordset.

    SELECT *
    FROM tblMain, tblsubMain
    WHERE tblSubMain.fkauto = tblMain.QuoteNo

    I can display a particular quote from the main table, but the detail shows the
    sub records for all quotes.

    I've also attached the code for the page.

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/Quotes.asp" -->
    <%
    ' *** Edit Operations: declare variables

    Dim MM_editAction
    Dim MM_abortEdit
    Dim MM_editQuery
    Dim MM_editCmd

    Dim MM_editConnection
    Dim MM_editTable
    Dim MM_editRedirectUrl
    Dim MM_editColumn
    Dim MM_recordId

    Dim MM_fieldsStr
    Dim MM_columnsStr
    Dim MM_fields
    Dim MM_columns
    Dim MM_typeArray
    Dim MM_formVal
    Dim MM_delim
    Dim MM_altVal
    Dim MM_emptyVal
    Dim MM_i

    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (Request.QueryString <> "") Then
    MM_editAction = MM_editAction & "?" & Request.QueryString
    End If

    ' boolean to abort record edit
    MM_abortEdit = false

    ' query string to execute
    MM_editQuery = ""
    %>
    <%
    ' *** Insert Record: set variables

    If (CStr(Request("MM_insert")) = "frmDetails") Then

    MM_editConnection = MM_Quotes_STRING
    MM_editTable = "tblsubMain"
    MM_editRedirectUrl = "InputDetails.asp"
    MM_fieldsStr =
    "Quote|value|Item|value|Prod|value|Desc|value|Qty| value|Price|value"
    MM_columnsStr =
    "fkauto|none,none,NULL|ItemNo|',none,''|CatalogNo| ',none,''|Product|',none,''|Qu
    antity|',none,''|ProductPrice|none,none,NULL"

    ' create the MM_fields and MM_columns arrays
    MM_fields = Split(MM_fieldsStr, "|")
    MM_columns = Split(MM_columnsStr, "|")

    ' set the form values
    For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
    Next

    ' append the query string to the redirect URL
    If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And
    Request.QueryString <> "") Then
    MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
    MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
    End If

    End If
    %>
    <%
    ' *** Insert Record: construct a sql insert statement and execute it

    Dim MM_tableValues
    Dim MM_dbValues

    If (CStr(Request("MM_insert")) <> "") Then

    ' create the sql insert statement
    MM_tableValues = ""
    MM_dbValues = ""
    For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
    MM_formVal = MM_emptyVal
    Else
    If (MM_altVal <> "") Then
    MM_formVal = MM_altVal
    ElseIf (MM_delim = "'") Then ' escape quotes
    MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
    Else
    MM_formVal = MM_delim + MM_formVal + MM_delim
    End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
    MM_tableValues = MM_tableValues & ","
    MM_dbValues = MM_dbValues & ","
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
    Next
    MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ")
    values (" & MM_dbValues & ")"

    If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
    Response.Redirect(MM_editRedirectUrl)
    End If
    End If

    End If
    %>
    <%
    Dim rsEntry
    Dim rsEntry_numRows

    Set rsEntry = Server.CreateObject("ADODB.Recordset")
    rsEntry.ActiveConnection = MM_Quotes_STRING
    rsEntry.Source = "SELECT * FROM tblMain, tblsubMain WHERE tblSubMain.fkauto
    = tblMain.QuoteNo"
    rsEntry.CursorType = 0
    rsEntry.CursorLocation = 2
    rsEntry.LockType = 3
    rsEntry.Open()

    rsEntry_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = -1
    Repeat1__index = 0
    rsEntry_numRows = rsEntry_numRows + Repeat1__numRows
    %>
    <html>
    <head>
    <title>Quote Details Input Form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_callJS(jsStr) { //v2.0
    return eval(jsStr)
    }
    //-->
    </script>
    </head>

    <body bgcolor="#CCCCFF" onLoad="MM_callJS('document.frmDetails.Item.focus( )')">
    <table width="673" border="0" align="center">
    <tr>
    <td colspan="2" align="default"><strong>Quote#</strong>
    <%=(rsEntry.Fields.Item("QuoteNo").Value)%></td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%"><strong>Acct #</strong></td>
    <td align="default"
    width="23%"><%=(rsEntry.Fields.Item("AccountNo").V alue)%></td>
    </tr>
    <tr>
    <td colspan="2" align="default">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td align="default"><strong>Name</strong> </td>
    <td align="default"><%=(rsEntry.Fields.Item("BusinessN ame").Value)%></td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td align="default"><strong>Address</strong> </td>
    <td align="default"><%=(rsEntry.Fields.Item("Address") .Value)%></td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td align="default" width="9%"><p>&nbsp;</p></td>
    <td align="default" width="34%"><%=(rsEntry.Fields.Item("City").Value) %>
    <%=(rsEntry.Fields.Item("State").Value)%>
    <%=(rsEntry.Fields.Item("Zipcode").Value)%> </td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="2" align="default">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="2" align="default"><strong>Phone</strong>
    <%=(rsEntry.Fields.Item("Phone").Value)%></td>
    <td align="default" width="23%"><strong>Fax</strong>
    <%=(rsEntry.Fields.Item("Fax").Value)%></td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="2" align="default">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="2" align="default"><strong>Quoted To</strong>
    <%=(rsEntry.Fields.Item("QuotedTo").Value)%></td>
    <td align="default" width="23%"><strong>Quoted By:
    </strong><%=(rsEntry.Fields.Item("QuotedBy").Value)% ></td>
    <td align="default" width="11%">&nbsp;</td>
    <td align="default" width="23%">&nbsp;</td>
    </tr>
    </table>
    <p align="center"><a href="input.asp"><img src="Images/Home.gif" width="125"
    height="25" border="0"></a></p>
    <form action="<%=MM_editAction%>" method="POST" name="frmDetails"
    id="frmDetails">
    <table width="619" border="0" cellspacing="1" cellpadding="1">
    <tr>
    <td width="60"><div align="center">Quote #</div></td>
    <td width="60"><div align="center">Item #</div></td>
    <td width="90"><div align="center">Product #</div></td>
    <td width="270"><div align="center">Description</div></td>
    <td width="30"><div align="center">Qty</div></td>
    <td width="90"><div align="center">Price</div></td>
    </tr>
    <%
    While ((Repeat1__numRows <> 0) AND (NOT rsEntry.EOF))
    %>
    <tr>
    <td><div align="center"><%=(rsEntry.Fields.Item("fkauto").V alue)%>
    </div></td>
    <td><div align="center"><%=(rsEntry.Fields.Item("ItemNo").V alue)%>
    </div></td>
    <td><div align="center"><%=(rsEntry.Fields.Item("CatalogNo" ).Value)%>
    </div></td>
    <td><div align="center"><%=(rsEntry.Fields.Item("Product"). Value)%>
    </div></td>
    <td><div align="center"><%=(rsEntry.Fields.Item("Quantity") .Value)%>
    </div></td>
    <td><div align="center"><%=(rsEntry.Fields.Item("ProductPri ce").Value)%>
    </div></td>
    </tr>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    rsEntry.MoveNext()
    Wend
    %>
    </table>
    <input type="submit" name="Submit" value="Submit">
    <input type="hidden" name="MM_insert" value="frmDetails">
    </form>

    </body>
    </html>
    <%
    rsEntry.Close()
    Set rsEntry = Nothing
    %>

    skwilliams Guest

  8. #7

    Default Re: Search Page

    Hmm - I might be able to recommend something if I understood precisely what
    this master page is doing and what this details page is doing. So you will have
    say 1 listing for 'quote_owner' or whatever you want to call it, and the
    details page would give us more than 1 quote (if applicable) for a given
    'quote_owner'? So if 1 user has 3-4 quotes, the details page should show them
    all? Is this what you have in mind? Bill

    Billium99 Guest

  9. #8

    Default Re: Search Page

    Exactly!

    I will enter a quote for John Doe with a quote number, his company name,
    address, etc..

    I then have a subform where I can enter each item to be contained on that
    quote including the Item number, Quantity, and Price.

    I'd then like to display it to other users in that format.

    I'd be happy to email you a screenshot of the MS Access Form that I'd like in
    ASP, if that would help.

    Thanks,



    skwilliams Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139