Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 March 31st, 2006, 02:47 AM
Registered User
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default onclick dynamic menu

basicly the subject explains what im trying to do
i have a menu for manufactures and it is connected to a db
i have a session variable named sessmanufacture
when u click on the manufacture say BMW i want sessmanufacture="BMW"
easy, then i want my second meny modles, to pick up on the session variable and sort all entries in my database (modles) by their manufacture (all that is setup)
i donno what im doing rong, and ive been trying Response.Write to see what sessmanufacture is set to but nothing ever comes up, i fugure its because it isnt refreshing, but im boggled, lol i ushally do VB not ASP lol ne help would be much appriciated, Thanks!

this is my MAnufacture menu
-----------------------------------------------
<select name="manmenu" id="manmenu">
<%
While (NOT getmanu.EOF)
%>
            <option value="<%=(getmanu.Fields.Item("Manufactures").Val ue)%>" onClick="(Session("sessmanufacture")=Request.Form( "manmenu")> <%=(getmanu.Fields.Item("Manufactures").Value)%> </option>
            <%
  getmanu.MoveNext()
Wend
If (getmanu.CursorType > 0) Then
  getmanu.MoveFirst
Else
  getmanu.Requery
End If
%>
</select>

 
Old March 31st, 2006, 02:53 AM
Registered User
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

and this is my second menu for modles.
__________________________________________________ ______



<select name="modmenu" id="modmenu">
            <%
While (NOT Recordset1.EOF)
%>
            <%
  Recordset1.MoveNext()
Wend
If (Recordset1.CursorType > 0) Then
  Recordset1.MoveFirst
Else
  Recordset1.Requery
End If
%>
            <%
While (NOT Recordset1.EOF)
%>
            <option value="<%=(Recordset1.Fields.Item("Modle").Value)% >"><%=(Recordset1.Fields.Item("Modle").Value)%> </option>
            <%
  Recordset1.MoveNext()
Wend
If (Recordset1.CursorType > 0) Then
  Recordset1.MoveFirst
Else
  Recordset1.Requery
End If
%>
          </select>

 
Old March 31st, 2006, 02:30 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You are trying to set the value of the session variable w/o calling back to the server. this line here:

onClick="(Session("sessmanufacture")=Request.Form( "manmenu")

I am actually suprised you are not getting a JS error of some sort, but anyway. You need to post back to the server to set your session, that above line won't do anything for you that is why your session variable is not getting set. If this were .NET you could just set the dropdown AutopostBack attribute to true and your problem would be solved but since you are using classic asp you are probably going to have to implement a little AJAX functionality to get this to work correctly.

Hope this helps

"The one language all programmers understand is profanity."
 
Old March 31st, 2006, 05:26 PM
Registered User
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

im not familure with AJAX, even in DW when i make a ASP jscrpit page, i dont what you mean the auto post bac, but i think im gunna rebuild the page on asp.net jscript, but where is the autogetback option (or w.e) in DW or do youd have to manually code it






Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic control onclick event mii2029 ASP.NET 3.5 Basics 7 August 27th, 2008 11:19 AM
dynamic menu in .net anuMScIT C# 2005 1 December 30th, 2006 12:26 PM
creating dynamic menu in jsp geethagowri J2EE 2 April 15th, 2006 01:49 AM





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