ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 27th, 2003, 05:25 PM
makman111 makman111 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Minneapolis, MN
Posts: 11 makman111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
XML based dynamic dropdown menus in ASP

I am trying to create an XML based set of nested drop down menus. Essentially you would have three (or n) menus (i.e. Make, model, year). Each menu is dependent on the value of the previous box to populate itself and is dynamically updated via JavaScript when its parent box is changed.

I know how to do this with JavaScript arrays, but populating the arrays in ASP from an SQL server can take some time, and the data is static within a 24 hour period. My idea is to have a XML doc stored on the server that the client can reference in the JavaScript routine and build the arrays on the client side w/o slowing the bogging down the page rendering with a SQL process.

Any help would be appreciated.

Thanks

JM

p.s.

here is how I am currently doing it with ASP rendering inside of JavaScript.

<% iIDC = 1 %>
<% Do While Not rsIDCGet.EOF %>

laIDC[<%=iIDC%>] = new IDC();
laIDC[<%=iIDC%>].myName = "<%=rsIDCGet("IDC")%>";
laIDC[<%=iIDC%>].LongValue = <%=rsIDCGet("IDCID")%>;
laIDC[<%=iIDC%>].Cust = new Array();

laIDC[<%=iIDC%>].Cust[0] = new Cust();
laIDC[<%=iIDC%>].Cust[0].myName = "Select a Customer";
laIDC[<%=iIDC%>].Cust[0].LongValue = -1;
laIDC[<%=iIDC%>].Cust[0].TmpHost = new Array('Select a Host');
<%
ComDBA.ParameterClear
ComDBA.Parameter 1, Session("LEID")
ComDBA.Parameter 2, Session("UserID")
ComDBA.Parameter 3, rsIDCGet("IDCID")

Set rsCustsGet = ComDBA.ExecProc("usp_mss_Customers_Get")

If ComDBA.ReturnCode <> 0 Then
Response.Write(ComDBA.ErrorDesc)
End If
%>
laIDC[<%=iIDC%>].Cust[1] = new Cust();
laIDC[<%=iIDC%>].Cust[1].myName = "All Customers";
laIDC[<%=iIDC%>].Cust[1].LongValue = 0;
laIDC[<%=iIDC%>].Cust[1].TmpHost = new Array('Select a Host','All Hosts');

<% iCust=2 %>
<% Do While Not rsCustsGet.EOF %>

laIDC[<%=iIDC%>].Cust[<%=iCust%>] = new Cust();
laIDC[<%=iIDC%>].Cust[<%=iCust%>].myName = "<%=Replace(rsCustsGet("CustName"),vbCrLf,"")%>";
laIDC[<%=iIDC%>].Cust[<%=iCust%>].LongValue = <%=rsCustsGet("CustID")%>;
<%

ComDBA.ParameterClear
ComDBA.Parameter 1, rsCustsGet("CustID")
ComDBA.Parameter 2, Session("UserID")

Set rsHostNamesGet = ComDBA.ExecProc("usp_mss_HostNames_Get")

If ComDBA.ReturnCode <> 0 Then
Response.Write(ComDBA.ErrorDesc)
End If

sHosts = "'Select a Host','All Hosts'"
Do While Not rsHostNamesGet.EOF
sHosts = sHosts & ",'" & rsHostNamesGet("HostName") & "'"
rsHostNamesGet.MoveNext
Loop
%>
laIDC[<%=iIDC%>].Cust[<%=iCust%>].TmpHost = new Array(<%=sHosts%>);

<% rsCustsGet.MoveNext() %>
<% iCust = iCust + 1 %>
<% Loop %>

<% rsIDCGet.MoveNext() %>
<% iIDC = iIDC + 1 %>
<% Loop %>

Reply With Quote
  #2  
Old March 8th, 2003, 11:37 PM
moexu moexu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 8 moexu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
An ADO Recordset object has an open method that can take an XML file as a parameter and parse it into a recordset. So you could have a SQL Server job that saved the XML file to the server, and use ADO within your ASP to get the values from the file.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > XML based dynamic dropdown menus in ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway