473,807 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

QueryString

229 New Member
Hi, Trying to solve a problem with no knowledge of asp.

I have a dropdown list populated from my database with card decription. The output is names like, abstract,illust ration etc.

I am sending the results to another page like so
Expand|Select|Wrap|Line Numbers
  1. .. html
  2. directory.asp?PostCardID=XX
  3.  
..
Now the request.queryst ring I presume should be something like this.
Expand|Select|Wrap|Line Numbers
  1. ..asp
  2. <%=request.QueryString("PostcardID")%>
  3.  
..
But all I get is xx as output.
When someone selects from the dropdown I am trying to populate the page with all those from the database who have the same title and so am trying to get the ids.

Is there something more to this, I am sure there is.
Thanks in advance for any help.

Basically I was told I had to get the get the PostCardID into the action querystring
Richard
Aug 5 '07
32 3885
jhardman
3,406 Recognized Expert Specialist
Richard,

Wait, let's see if I understand. There is one dropdown list that allows the user to select a category of postcard. You have this selection submitted to a second page where you want to display a dropdown list of all of the cards in that category. Please confirm that this is right.

I'm still not sure what part is giving you trouble. You got the first page to give you a dropdown list, right? Are you still not getting the second page to give you a list of the cards in that category?

Jared
Aug 7 '07 #11
fran7
229 New Member
Dear Jared, thanks for the reply. Not quite right.
I have a dropdown on one page populated with the carddescription s from the database. I want to send the submitted selection to the next page to display in the table like other links display, not in another dropdown list. At the moment if you select abstract, what displays on the next page is simply the word abstract and not the sites that are listed in my database under that carddescription .

I need carddescription in the dropdown as they are the headings like abstract etc and I was led to believe that I needed to send the id to the next page to display the relevant sites.

So basically I need to send the id relevant to the selection, but when I tried that
with asp?cardID=xx, I just got xx appearing in the next page.

I dont know if that helps you to understand. I am stabbing in the dark trying to figure this out. basically if you visited wotartist .com you would see what I need to appear.

Thanks
Richard
Aug 7 '07 #12
jhardman
3,406 Recognized Expert Specialist
I have a dropdown on one page populated with the carddescription s from the database. I want to send the submitted selection to the next page to display in the table like other links display, not in another dropdown list. At the moment if you select abstract, what displays on the next page is simply the word abstract and not the sites that are listed in my database under that carddescription .
OK, not a big difference, I think I get you. maybe. The first page gets categories in a drop down select and the second displays a table with links to each of the art in that category. It looks like you have a good start, though. The first page already gives you a list of categories and the second page checks to make sure it was sent data (the response.write request.queryst ring line only checks to see if data was sent). The second page also opens the database, as I looked over the code. Does it not display anything from the database, or is it displaying stuff from the db that you didn't select? I couldn't tell. It looks to me like when the second page opens the db you want it to say this:
Expand|Select|Wrap|Line Numbers
  1. strSQL = "SELECT * FROM tblGreetingPostCards WHERE CardDescription = '" & request.querystring("PostCardID") & "' ORDER BY Rnd([PostCardID])"
  2.     oRs.Open strSQL, conn 'this opens everything from the db that has 
  3.        'CardDescription = the data sent from the first page.  Then you need to put 
  4.        'each link you get into a table
  5.  
  6.       response.write "<table><tr>"
  7.       dim x
  8.  
  9.       x = 0
  10.  
  11.     Do while not oRs.EOF
  12.         x = x + 1
  13.         if x = 5 then
  14.            response.write "</tr><tr>" 'start a new row every five records
  15.            x = 0
  16.         end if 
  17.  
  18.         'I just pulled the content of the table cell from you code example %>
  19.         <td><br><font size="2"><p></p> 
  20.         <a onmouseover="doTooltip(event,'<img
  21.         src="<%=Server.URLPathEncode(rsCard("ThumbnailURL"))%>" alt=""  
  22.         border="0"><div class="tp2">
  23.         <%
  24.         If Trim(rsCard("Author"))<>"" Then  %>
  25.            <%=rsCard("Author")%>
  26.         <%
  27.         End If %>
  28.         </div>' )"
  29.         onmouseout="hideTip()"
  30.         href="http://<%=rsCard("DefaultHeadline")%>"
  31.         target="_blank"><%=rsCard("CardDescription")%></a>
  32.         </font>
  33.         <p align="left"><font size="1"><span style="color : #303030;">
  34.         <%
  35.         If  Trim(rsCard("Author"))<>"" Then %>
  36.            <%=rsCard("Author")%>
  37.         <%
  38.         End If %>
  39.         </font></span>
  40.         <p align="left"><font face="<%=FontName%>" size="1"><a
  41.         href="card.asp?PostCardID=<%=rsCard("PostCardID")%>">
  42.         <I><%=rsCard("DefaultMessage")%></I><a></td>
  43.         <% 
  44.         oRs.MoveNext
  45.     loop
  46.     response.write "</tr></table>"
I need carddescription in the dropdown as they are the headings like abstract etc and I was led to believe that I needed to send the id to the next page to display the relevant sites.

So basically I need to send the id relevant to the selection, but when I tried that
with asp?cardID=xx, I just got xx appearing in the next page.
right, you need to send the thing the user selected in the first page to the second page, but all they actually selected is a card ID. You need to connect to the db again to see what the card ID means, ie "SELECT * FROM myTable WHERE cardID = " & request("dardID "). Does this make sense?

I dont know if that helps you to understand. I am stabbing in the dark trying to figure this out. basically if you visited wotartist .com you would see what I need to appear.
I checked out wotartist.com and I think I'm more confused than when I started. Is that supposed to be an example of how it is supposed to work, or is it a work in progress? I definitely don't see the problem you are describing. Is your script page in testing up at a URL where we can check it out?

Jared
Aug 7 '07 #13
fran7
229 New Member
Dear Jared, I have to thank you for your help.

www.wotartist. com/right.asp

is where I have the dropdown test popluated from the database. You will see when taken to the next test page, that you just get one carddescription shown. What I am trying to get happening is what happens when you search for a word or use the main country categories, that the page is populated with the relevant links to the category selected from the dropdown.

If you look at any country category on the site you will see that artists have a heading, eg, watercolor, abstract etc. It is those that I want to only appear when someone selects from the dropdown.
Thanks
Richard
Aug 7 '07 #14
jhardman
3,406 Recognized Expert Specialist
a Ha! The problem is that you have an error on line 229. Which is line 229? it's one of these:
Expand|Select|Wrap|Line Numbers
  1. <%   
  2.     If Not rsCard.EOF Then
  3.     rsCard.AbsolutePage = intPage
  4.  
  5.  
  6.    For intRecord = 1 To rsCard.PageSize
  7.     CurrentColumn=1
  8. %>
There is some object definition missing, and this is always a tricky problem to find.

I notice the page is set up to either return search results or display results from a category. You have never tested it with search results though, right?

Jared
Aug 7 '07 #15
fran7
229 New Member
Hi Jared, Thats strange as line 229 is an empty line. This code finishes on line 228

<p align="left"><f ont size="1"><span style="color : #303030;"><%If Trim(rsCard("Au thor"))<>"" Then%> <%=rsCard("Auth or")%><%End If%></font></span>
<p align="left"><f ont face="<%=FontNa me%>" size="1"><a href="card.asp? PostCardID=<%=r sCard("PostCard ID")%>">
<I><%=rsCard("D efaultMessage") %></I><a>

Thanks

Richard
Aug 7 '07 #16
fran7
229 New Member
Hi Jared, That error comes up if the page is accessed directly. ie manner.asp in the address bar. It doesnt occur if you search or enter by category, only if there is no object.
Thanks
Richard
Aug 7 '07 #17
jhardman
3,406 Recognized Expert Specialist
Richard

BTW, what are you using to edit the page? some editors will number the lines for you, and they tend to be fairly accurate. I can think of a couple reasons your count may be a little off from what the server says, but there's an easy way to check. Put one more blank line before the line you think is causing the error, and one line after. If the line you thought is the problem really is the problem, the error message will now say the error is on line 230. If it is after that line, the error message will say line 231. If it is before that line, the error message will not change. My best guess is that the error is coming from this line:
Expand|Select|Wrap|Line Numbers
  1.     If Not rsCard.EOF Then
put one blank line before and one after and see what the error message says.

Jared
Aug 7 '07 #18
fran7
229 New Member
Hi Jared, You are right, it didnt change but did when I added another blank line before the line you think is the problem
Thanks Richard
Aug 7 '07 #19
jhardman
3,406 Recognized Expert Specialist
Hi Jared, You are right, it didnt change but did when I added another blank line before the line you think is the problem
Thanks Richard
so now it says the error is on line 231, which means the error is after the line I thought. I still think it has to be one of those four I said in post 16. Test it on the next line. What you are looking for is the line that makes the error line only go up one number.

Jared
Aug 7 '07 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

3
17291
by: Arpan | last post by:
A link has the following URL: <a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%= Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2") %>&cplace=<%= Request.QueryString("cplace") %>">Click</a> Suppose the names in the above querystring have the following values: cname="Danny" cadd1="House 97"
2
2099
by: Mikael | last post by:
Hi All! I have a problem here and i can't see what it is... My parameters (value) are shopped off. exampe "Hello world" will end up like "hello" How should i adjust the syntax to get a whole string that is not shopped off? Thanks Mike
1
6753
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string: popup.html?pImage=30_leilani_dowding_b_060.jpg&ordRef=1000&Title=Leilani&nbsp;Dowding using the QueryString function below, the pImage variable should be
5
5200
by: David | last post by:
Hello I need to take some values and place them in a string in the format of a querystring. Lets say I have: string State = "ACT"; string SearchString = "Tax"; int MinRelevance = 50;
4
19754
by: Raterus | last post by:
Howdy, Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to appear in the url anymore. How can I get rid of it? A postback doesn't clear it, it just keeps tagging along. I tried Request.QueryString.Clear, but get "readonly" errors. I want to do this, because eventually I use server.transfer within this...
12
5295
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... www.something.com/main.aspx?client Client is the QueryString, but no value is given. This would mean to me that client exists, so its value is true. In the code behind, I can tell that client exists using Request.QueryString.Keys.Count, which equals 1....
3
3135
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so that I can check for the existance of a parameter value in that previous querystring.
1
5984
by: beebee | last post by:
Hi all. I am having a bit of difficulty: Here is what is happening: I have an application that spits out a thankyou.aspx page and i would like to pass it the querystring values it had collected before loading the thankyou page. This is completed. NOw on the thankyou.aspx page i am getting the following error: Compiler Error Message: CS0120: An object reference is required for the nonstatic field, method, or property...
4
5966
by: =?Utf-8?B?RVcgTmV3Ymll?= | last post by:
My apologies in advance if there is a better forum for this question. Given the following snippet: <script type="text/c#" runat="server"> protected void Page_Load(Object Sender, EventArgs e) { if ( Request.QueryString.Count 0 ) { if ( Request.QueryString != "" )
3
2162
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record must be submitted with a unique key, while everything is the same, these 4 fields must be different.... Idealy, these are the codes. please teach me how to do it. objConn.Open(sConnection) sRowNum = request.querystring("row_num")
0
9720
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10626
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10112
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.