persisting querystring value

Results 1 to 3 of 3

Thread: persisting querystring value

  1. #1
    hollly Guest

    Default persisting querystring value

    I use a request.querystring in a Javascript winOpen function to open a new pop-up window. This window displays info (drawn dynamically) based on the month selected (in the querystring).<BR>Once I&#039m in the new popup window, with the new data displayed in a table, I want to be able to sort that information in various ways. Problem is that I&#039m having trouble persisting the querystring value to the sort SQL statements. <BR><BR>HEre is the code:<BR>mySQL = "SELECT * FROM marketing_Report_SL WHERE (myMonth = &#039" & Request.QueryString("xID") & "&#039) ORDER BY myUser"<BR><BR>if Request.Form("btnSort") = "A-Z" THEN<BR>mySQL = "SELECT * FROM marketing_Report_SL WHERE (myMonth = &#039" & Request.QueryString("xID") & "&#039) ORDER BY myUser"<BR>end if<BR> <BR>if Request.Form("btnSort") = "Z-A" THEN<BR>mySQL = "SELECT * FROM marketing_Report_SL WHERE (myMonth = &#039" & Request.Form("rsSelect") & "&#039) ORDER BY myUser DESC"<BR>end if<BR><BR>Set rs = oQuery.RunQuery(Cstr(strDB), Cstr(mySQL))<BR><BR><BR>The original sql statement is great. When I response.write it it&#039s perfect. Yet, when I click the sort button, the month value just isn&#039t there. I&#039ve tried variables and even a session object--am I just overlooking something stupid?<BR><BR>ANy help appreciated!!

  2. #2
    Rude Jake Guest

    Default RE: persisting querystring value

    When you launch the window, are you using the form to pass the vars into the querystring or are you using both the form and a generated query string?<BR><BR>It sounds to me that the window you are opening has a generated querystring, but you are not passing that var into you new form in the popup window...<BR><BR>For example:<BR>Is your form action "/process.asp" or "process.asp?xID=January" or even "process.asp?xID=&#060;%Server.URLEncode(Request(" xID"))%&#062;"<BR><BR>BTW:<BR>You can request either Form or QueryString by using just:<BR>Request("[variable name]") instead of Request.Form("[variable name]") or Request.QueryString("[variable name]")...

  3. #3
    Join Date
    Dec 1969

    Default RE: persisting querystring value

    This is my code:<BR>var strOpen = "access_user.asp?xID=" + userStuff<BR><BR>Then I call the value by request("xID")....<BR><BR>I had some success with passing the value to the sort options by putting a hidden input field in the form that holds the sort buttons. THis works for the first sort, but once you have sorted by, say Z-A, choosing anohter sort method, say "by Date" causes the same error--the querystring value doesn&#039t reach the sql query. I get this error:<BR>SELECT * FROM marketing_Report_SL WHERE (myMonth = &#039&#039) ORDER BY myUser &#062;&#062;&#062;&#062;this is my response.write mySQl, notice the myMonth value...<BR><BR>ADODB.Recordset error &#039 800a0bcd&#039 <BR><BR>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. <BR><BR>/SalesLibrary/access_user.asp, line 47

Posting Permissions

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