473,545 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP calling same page on Index selection

Hi All.

I have an ASP page that has over 150 records listed. I would like to
have an "Index" (A,B,C,D...) at the very top of the page.
Once a letter is clicked, I need to:
1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
& UCASE(strSelect ed) & "*" & Chr(34)

2) Recall the SAME page (Not another ASP page) withpopulating with the
new recordset.

I am having a total brain fart on this and can't figure it out.
Any help would be appreciated.

TIA
Jul 19 '05 #1
5 1768
"Chris Anderson" wrote:
: Hi All.
:
: I have an ASP page that has over 150 records listed. I would like to
: have an "Index" (A,B,C,D...) at the very top of the page.
: Once a letter is clicked, I need to:
: 1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
: & UCASE(strSelect ed) & "*" & Chr(34)
:
: 2) Recall the SAME page (Not another ASP page) withpopulating with the
: new recordset.

Something like this?

http://kiddanger.com/lab/spandex.asp
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #2
On Sun, 15 Feb 2004 05:02:07 -0600, "Roland Hall" <nobody@nowhere >
wrote:
"Chris Anderson" wrote:
: Hi All.
:
: I have an ASP page that has over 150 records listed. I would like to
: have an "Index" (A,B,C,D...) at the very top of the page.
: Once a letter is clicked, I need to:
: 1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
: & UCASE(strSelect ed) & "*" & Chr(34)
:
: 2) Recall the SAME page (Not another ASP page) withpopulating with the
: new recordset.

Something like this?

http://kiddanger.com/lab/spandex.asp


This would be the index part, yes.
Although this appears to be Javascript and I am using vbscript.

But how whould I call the same page back with the new SQL statement?

Thanks.
Jul 19 '05 #3
"Chris Anderson" wrote:
: On Sun, 15 Feb 2004 05:02:07 -0600, "Roland Hall" <nobody@nowhere >
: wrote:
:
: >"Chris Anderson" wrote:
: >: Hi All.
: >:
: >: I have an ASP page that has over 150 records listed. I would like to
: >: have an "Index" (A,B,C,D...) at the very top of the page.
: >: Once a letter is clicked, I need to:
: >: 1) Call a SQL string like "SELECT * from WoD Where UCASE(WotD) LIKE "
: >: & UCASE(strSelect ed) & "*" & Chr(34)
: >:
: >: 2) Recall the SAME page (Not another ASP page) withpopulating with the
: >: new recordset.
: >
: >Something like this?
: >
: >http://kiddanger.com/lab/spandex.asp
:
: This would be the index part, yes.
: Although this appears to be Javascript and I am using vbscript.
:
: But how whould I call the same page back with the new SQL statement?

This is VBScript on the server side and DHTML on the client side. VBScript
doesn't support events. If you're using IE, which is the only browser that
supports VBScript on the client side, then this will work just fine.

This is the server side:

if Request.QuerySt ring("ndx") <> "" Then
Response.Write( "<div id=""ndx"">You chose " & Request.QuerySt ring("ndx") &
"</div>")
end if

The client side passes the index on the URL. The server side grabs it when
it reloads the page. Now that you have the index identified, you write your
server side code to make a connection to the server, grab the relevant data
by passing your SQL statement and then output the contents.

I wrote CSS to position the Index 5px down, 5px across. I positioned my
example to show the result below that. You would position your content in a
similar fashion. I suggest making a call to the server, grab the data with
rs.getrows(), create your loop, and in it, output your data.

<%
dim r, iCols, iRows, nCols, nRows, rThis

' make connection to db
' execute SQL statement and retrieve data in rs.getrows()

r = rs.getrows()
conn.close
set conn = nothing
set rs = nothing

' write FOR...NEXT loops and display data

nCols = ubound(r,1) ' number of columns
nRows = ubound(r,2) ' number of rows

for iRows = 0 to nRows
Response.Write( "<div class=""divRows "">)
for iCols = 0 to nCols
rThis = r(iCols, iRows)
Response.Write( "<span>" & rThis & "</span>")
next
Response.Write( "</div")
next
%>

I just jotted this down here so it is untested. The divRows class should
not have CSS positioning information. Put it in a container that has
positioning so you know where to start.

HTH...
Jul 19 '05 #4
On Sun, 15 Feb 2004 16:54:35 -0600, "Roland Hall" <nobody@nowhere >
wrote:

This is VBScript on the server side and DHTML on the client side. VBScript
doesn't support events. If you're using IE, which is the only browser that
supports VBScript on the client side, then this will work just fine.

This is the server side:

if Request.QuerySt ring("ndx") <> "" Then
Response.Write( "<div id=""ndx"">You chose " & Request.QuerySt ring("ndx") &
"</div>")
end if

The client side passes the index on the URL. The server side grabs it when
it reloads the page. Now that you have the index identified, you write your
server side code to make a connection to the server, grab the relevant data
by passing your SQL statement and then output the contents.

I wrote CSS to position the Index 5px down, 5px across. I positioned my
example to show the result below that. You would position your content in a
similar fashion. I suggest making a call to the server, grab the data with
rs.getrows() , create your loop, and in it, output your data.

<%
dim r, iCols, iRows, nCols, nRows, rThis

' make connection to db
' execute SQL statement and retrieve data in rs.getrows()

r = rs.getrows()
conn.close
set conn = nothing
set rs = nothing

' write FOR...NEXT loops and display data

nCols = ubound(r,1) ' number of columns
nRows = ubound(r,2) ' number of rows

for iRows = 0 to nRows
Response.Write( "<div class=""divRows "">)
for iCols = 0 to nCols
rThis = r(iCols, iRows)
Response.Write( "<span>" & rThis & "</span>")
next
Response.Write( "</div")
next
%>

I just jotted this down here so it is untested. The divRows class should
not have CSS positioning information. Put it in a container that has
positioning so you know where to start.

HTH...


Yep. Just saw that. The bad past is that at least 1/2 of the ppl
hitting this site will use Mozilla or Netscape.
I need an all browser solutioin. Hm...
Jul 19 '05 #5
"Chris Anderson" wrote:
: Yep. Just saw that. The bad past is that at least 1/2 of the ppl
: hitting this site will use Mozilla or Netscape.
: I need an all browser solutioin. Hm...

Chris...

Server-side works with any browser so it is ok to use VBScript there. I'm
using DHTML on the client-side, not VBScript, so this IS an all browser
solution or more of one than VBScript, as you requested. I apologize if
that was not clear in my earlier post.

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
6514
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html ...
3
3841
by: usenet | last post by:
Hi All, I have some initialization to be done at page load time, which changes the text of some anchors so that they are consistent with the query string (these anchors are used as criteria selectors, and should be initialized to the criteria contained within the url). IE and Safari fire the onload event before rendering any elements, so...
4
4076
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is dependant on data collected in the code behind on the server. I have set AutoPostback to false for the controls and added lines such as...
4
1808
by: Paul | last post by:
Hi I have a page that pops up a warning box if a selection is not made, see below. <script language="javascript" event="onclick" for="btn_submit"> if(document.Form1.drp_dn_arriv.selectedIndex==0) window.alert("Missing Arrival Time"); Anyhow the btn_submit will post back to the server and reload the page. Just wondering if anyone knows how to...
3
9064
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. If the web service is taking a long time to complete, the aspx page returns a ‘The operation has timed-out.’ Message to the web browser after...
8
2184
by: Radx | last post by:
Here in my web application, I have a data entry page with serval controls. Some of the controls have autopostback is set true. But the problem is when two or more people are entering data at the same time, in the middle of my data entry , it is brining someelse data on my screen. I look everywhere i could not find the solution. Please help...
9
3169
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
5
1386
by: gw7rib | last post by:
I'm writing a program which has "notes" - these can appear on the screen as windows with text in. It is possible to create an "index note" - at present, this will contain a list of the titles (or other data, you can choose) of some or all of the notes - you can choose the selection criteria. Thus you can create notes to store any text you...
9
5645
by: unlikeablePorpoise | last post by:
I would like to have an HTML dropdown list where each selection calls a method. The following code doesn't work, but it I hope it gives the idea of what I'm trying to do: <FORM NAME="frm"> <SELECT NAME="sel" onChange="document.frm.sel.options.value"> <OPTION SELECTED value="">--choose-- <OPTION VALUE="<% package1.method1; %>">Call Method...
0
7486
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...
0
7676
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. ...
0
7932
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...
0
7776
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...
0
6001
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...
1
5347
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4965
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...
0
3473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.