uldradev reloade listmenu til samme side
hvordan reloader jeg nye data og samtidligt bevare menuen selected? her er koden.<%@LANGUAGE=\"VBSCRIPT\"%>
<!--#include file=\"Connections/data.asp\" -->
<%
set rs_list = Server.CreateObject(\"ADODB.Recordset\")
rs_list.ActiveConnection = MM_data_STRING
rs_list.Source = \"SELECT * FROM tbl_web\"
rs_list.CursorType = 0
rs_list.CursorLocation = 2
rs_list.LockType = 3
rs_list.Open()
rs_list_numRows = 0
%>
<%
Dim rs_indhold__MMColParam
rs_indhold__MMColParam = \"1\"
if (Request.QueryString(\"id\") <> \"\") then rs_indhold__MMColParam = Request.QueryString(\"id\")
%>
<%
set rs_indhold = Server.CreateObject(\"ADODB.Recordset\")
rs_indhold.ActiveConnection = MM_data_STRING
rs_indhold.Source = \"SELECT * FROM tbl_web WHERE id = \" + Replace(rs_indhold__MMColParam, \"\'\", \"\'\'\") + \"\"
rs_indhold.CursorType = 0
rs_indhold.CursorLocation = 2
rs_indhold.LockType = 3
rs_indhold.Open()
rs_indhold_numRows = 0
%>
<%
\' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
\' create the list of parameters which should not be maintained
MM_removeList = \"&index=\"
If (MM_paramName <> \"\") Then MM_removeList = MM_removeList & \"&\" & MM_paramName & \"=\"
MM_keepURL=\"\":MM_keepForm=\"\":MM_keepBoth=\"\":MM_keepNone=\"\"
\' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = \"&\" & Item & \"=\"
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
\' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = \"&\" & Item & \"=\"
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
\' create the Form + URL string and remove the intial \'&\' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> \"\") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> \"\") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> \"\") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
\' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> \"\") Then
MM_joinChar = \"&\"
Else
MM_joinChar = \"\"
End If
End Function
%>
<html>
<head>
<title>grabit</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<form name=\"menu_indhold\" method=\"get\" action=\"\">
<select name=id onChange=\"if (this.options[this.selectedIndex].value != \'\') { location.href = this.options[this.selectedIndex].value; };\">
<%
While (NOT rs_list.EOF)
%>
<option value=\"index.asp?=<%=(rs_list.Fields.Item(\"id\").Value)%>\" ><%=(rs_list.Fields.Item(\"teknologi\").Value)%></option>
<%
rs_list.MoveNext()
Wend
If (rs_list.CursorType > 0) Then
rs_list.MoveFirst
Else
rs_list.Requery
End If
%>
<option selected><%=(rs_indhold.Fields.Item(\"teknologi\").Value)%></option>
</select>
</form>
<br>
<p><%=(rs_indhold.Fields.Item(\"overskrift\").Value)%><br>
</p>
<p><%=(rs_indhold.Fields.Item(\"kort_beskrivelse\").Value)%><br>
</p>
</body>
</html>
<%
rs_list.Close()
%>
<%
rs_indhold.Close()
%>
