Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2004, 07:03 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use Onclick function for this

Hi,
I am retrieving Hierarichical data from data base on the basis of parentid and want to show child data on Clicking on parent data.Code written is using layers .4 level of data is existing on click of 2nd data i want 3rd and 4th level data to be displayed .In this code if I remove mouseover ,On clicking the Subcategory ,Data gets overridden on the first data which i got from when i click first Subcategory.
Please let me know how to make the data stay at the place and on next click it should show corresponding data without overwriting on first.


Set courrs = Server.CreateObject("ADODB.recordset")
strQuery1="select * from course_master where course='Nets'"
courrs.Open strQuery1,objConn, 3, 3

<%
strQuery2="select * from category_mast where courseid=" &courrs("courseid")
catrs.Open strQuery2,objConn, 3, 3
if not catrs.EOF then
while not catrs.eof %>

 <p class="head-1"><%=catrs("category")%></p>
<%strQuery3="select * from subcategory_mast where categoryid=" & catrs("categoryid")
subcatrs.Open strQuery3,objConn, 3, 3%>
<%while not subcatrs.EOF%>
<p>- <a class="right-link" href="#" onClick="MM_showHideLayers('<%=subcatrs("subcatego ry")%>','','show','curr-main','','hide')" onMouseOut="MM_showHideLayers('<%=subcatrs("subcat egory")%>','','hide','curr-main','','show')"><%=subcatrs("subcategory")%></a><br>

<%
                             strQuery4="select * from curriculum_mast where subcategoryid=" & subcatrs("subcategoryid")
currirs.Open strQuery4,objConn, 3, 3
while not currirs.EOF%>

<div id="<%=subcatrs("subcategory")%>" style="position:absolute; left:310px; top:145px; width:256px; height:169px; z-index:2; visibility: hidden">
 <p class="head-1"><%Response.Write(currirs("curriculum"))%></p>

<%
strQuery5="select * from content_mast where curriculumid=" & currirs("curriculumid")
conrs.Open strQuery5,objConn, 3, 3
while not conrs.EOF %>
 <%Response.Write(conrs("content"))%><br>
<%conrs.MoveNext
wend
conrs.Close%>
<%currirs.MoveNext
 wend
 currirs.Close%>
 </div>
  <% subcatrs.MoveNext
  wend
 subcatrs.Close %>
  <%catrs.MoveNext
   wend
   end if%>






 
Old June 21st, 2004, 07:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Jaya2109,

Does this not make the page heavily loaded, by using as much as 5 recordsets and every 4 inner recordsets being populated for every main category?

May be you can have the highest level of categories listed first and on click of any category you can reload the page to show that particular category expanded. Not sure if that suits your requirement.

Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 21st, 2004, 11:59 PM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vijay,
Actually this page comes out as a popup window when a student selectes a particular course while filling a form to register for some course in an institute.This page facilitates him to go through the curriculum which will be taught to them in that selected course.If I make new window for each category it will be difficult for them to reach back to the form and continue filling after looking the curriculum.

Anyway thanks I will try to do that.
Jaya

 
Old June 22nd, 2004, 12:38 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I think I misunderstood.How to reload the page with Onclick.Do I need to pass some QueryString?

Actually I am a fresher.

Jaya

 
Old June 22nd, 2004, 06:27 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

<a href=# onclick=history.go(0)>click</a>

HTH,

Snib

<><
 
Old June 22nd, 2004, 07:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, you should be passing the CATEGORYID or some key vale as querystring to get the sub category re-queried on.

Cheers!

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Button onclick function in Repeater rathbird General .NET 12 April 5th, 2007 03:17 AM
Invoke onClick() function when body onLoad muklee Javascript How-To 2 March 16th, 2007 01:02 AM
onClick crmpicco Javascript How-To 1 March 21st, 2005 09:18 AM
onClick crmpicco HTML Code Clinic 2 February 24th, 2005 11:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.