Problems with listbox and asp and request.querystring. 
Author Message
 Problems with listbox and asp and request.querystring.

Hi.
Im new to asp, and really dont understand how to pass a querystring to an
asp page.

if i manually write in "page.asp?server=computername" everyting works right.
But i have a VBScript that populates a list, and i dont get how i get the
selected value in the list to the querystring:)

Below is the code.

-----------------------------------------------------------------
<html>
<head>

<SCRIPT LANGUAGE="VBScript">

Public Server

Function ComputerList_DropButtonClick()

strDomain = document.f1.DomainList.value

'window.alert(strDomain)

'document.f1.ComputerList.Clear

Set objDom = GetObject("WinNT://" & strDomain)

objDom.Filter = Array("computer")

for each computer in objDom

strGroupName = computer.Name

document.f2.ComputerList.AddItem(strGroupName)

next

End Function

</script>

<SCRIPT LANGUAGE="VBScript">

Function GetDomains()

Set objDom = GetObject("WinNT:")

objDom.Filter = Array("domain")

for each domain in objDom

strDomainName = domain.Name

Document.f1.DomainList.AddItem(strDomainName)

next

End Function

</script>

<SCRIPT FOR="B1" EVENT="onClick" LANGUAGE="VBScript">

Server = Document.f2.ComputerList.Value

</SCRIPT>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>COmputer Information</title>

<base target="_compinfo">

</head>

<body>

<p>

<form id="f1" action="" method="GET" name="f1" target="compinfo">

<OBJECT ID="DomainList" WIDTH=140
CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3" height="26" border="0">

<param name="VariousPropertyBits" value="746604571">

<param name="BackColor" value="2147483653">

<param name="ForeColor" value="2147483656">

<param name="MaxLength" value="0">

<param name="BorderStyle" value="0">

<param name="ScrollBars" value="0">

<param name="DisplayStyle" value="3">

<param name="MousePointer" value="0">

<param name="Size" value="3704;688">

<param name="PasswordChar" value="0">

<param name="ListWidth" value="0">

<param name="BoundColumn" value="1">

<param name="TextColumn" value="65535">

<param name="ColumnCount" value="1">

<param name="ListRows" value="8">

<param name="cColumnInfo" value="0">

<param name="MatchEntry" value="1">

<param name="ListStyle" value="0">

<param name="ShowDropButtonWhen" value="2">

<param name="ShowListWhen" value="1">

<param name="DropButtonStyle" value="1">

<param name="MultiSelect" value="0">

<param name="Value" value="Select Domain">

<param name="Caption" value="Select Domain">

<param name="PicturePosition" value="458753">

<param name="BorderColor" value="2147483654">

<param name="SpecialEffect" value="2">

<param name="Accelerator" value="0">

<param name="GroupName" value>

<param name="FontName" value="MS Sans Serif">

<param name="FontEffects" value="1073741824">

<param name="FontHeight" value="160">

<param name="FontOffset" value="0">

<param name="FontCharSet" value="0">

<param name="FontPitchAndFamily" value="2">

<param name="ParagraphAlign" value="1">

<param name="FontWeight" value="0">

</OBJECT>

</form>

<form ID="f2" action="" method="GET" name="f2" target="compinfo">

<OBJECT ID="ComputerList" WIDTH=140
CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3" height="26">

<param name="VariousPropertyBits" value="746604571">

<param name="BackColor" value="2147483653">

<param name="ForeColor" value="2147483656">

<param name="MaxLength" value="0">

<param name="BorderStyle" value="0">

<param name="ScrollBars" value="0">

<param name="DisplayStyle" value="3">

<param name="MousePointer" value="0">

<param name="Size" value="3704;688">

<param name="PasswordChar" value="0">

<param name="ListWidth" value="0">

<param name="BoundColumn" value="1">

<param name="TextColumn" value="65535">

<param name="ColumnCount" value="1">

<param name="ListRows" value="8">

<param name="cColumnInfo" value="0">

<param name="MatchEntry" value="1">

<param name="ListStyle" value="0">

<param name="ShowDropButtonWhen" value="2">

<param name="ShowListWhen" value="1">

<param name="DropButtonStyle" value="1">

<param name="MultiSelect" value="0">

<param name="Caption" value="Select Computer">

<param name="PicturePosition" value="458753">

<param name="BorderColor" value="2147483654">

<param name="SpecialEffect" value="2">

<param name="Accelerator" value="0">

<param name="GroupName" value>

<param name="FontName" value="MS Sans Serif">

<param name="FontEffects" value="1073741824">

<param name="FontHeight" value="160">

<param name="FontOffset" value="0">

<param name="FontCharSet" value="0">

<param name="FontPitchAndFamily" value="2">

<param name="ParagraphAlign" value="1">

<param name="FontWeight" value="0">

</OBJECT>

</form>

<form id="f3" action="computerinfo.asp" method="GET" name="f3"
target="compinfo">

<input type="submit" value="Submit" name="Server" style="font-size: 12pt">

</form>

<br>

<br><br>

<IFRAME Name='compinfo' APPLICATION="yes" SRC="about:blank" WIDTH="60%"
HEIGHT="80%"></IFRAME>

<br>

<script language="vbscript">

<!--

Sub window_OnLoad()

Call GetDomains()

End Sub

//-->

</Script>

</body>

</html>



Tue, 22 Mar 2005 13:34:17 GMT  
 Problems with listbox and asp and request.querystring.
Solved it..:) just being stupid i guess:))

----------------------------------------------------------------------------
--------------------------------------------------------------------

<html>

<head>

<SCRIPT LANGUAGE="VBScript">

Public Server

Function ComputerList_DropButtonClick()

strDomain = document.f1.DomainList.value

'window.alert(strDomain)

'document.f1.ComputerList.Clear

Set objDom = GetObject("WinNT://" & strDomain)

objDom.Filter = Array("computer")

for each computer in objDom

strGroupName = computer.Name

document.f1.ComputerList.AddItem(strGroupName)

next

End Function

</script>

<SCRIPT LANGUAGE="VBScript">

Function GetDomains()

Document.f1.ComputerList.Clear

Set objDom = GetObject("WinNT:")

objDom.Filter = Array("domain")

for each domain in objDom

strDomainName = domain.Name

Document.f1.DomainList.AddItem(strDomainName)

next

End Function

</script>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>COmputer Information</title>

<base target="compinfo">

</head>

<body>

<p>

<form id="f1" action="monitor/asp-scripts/computerinfo.asp" method="GET"
name="f1" target="compinfo">

<OBJECT ID="DomainList" Name="DomainList" WIDTH=140
CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3" height="26" border="0">

<param name="VariousPropertyBits" value="746604571">

<param name="BackColor" value="2147483653">

<param name="ForeColor" value="2147483656">

<param name="MaxLength" value="0">

<param name="BorderStyle" value="0">

<param name="ScrollBars" value="0">

<param name="DisplayStyle" value="3">

<param name="MousePointer" value="0">

<param name="Size" value="3704;688">

<param name="PasswordChar" value="0">

<param name="ListWidth" value="0">

<param name="BoundColumn" value="1">

<param name="TextColumn" value="65535">

<param name="ColumnCount" value="1">

<param name="ListRows" value="8">

<param name="cColumnInfo" value="0">

<param name="MatchEntry" value="1">

<param name="ListStyle" value="0">

<param name="ShowDropButtonWhen" value="2">

<param name="ShowListWhen" value="1">

<param name="DropButtonStyle" value="1">

<param name="MultiSelect" value="0">

<param name="Value" value="Select Domain">

<param name="Caption" value="Select Domain">

<param name="PicturePosition" value="458753">

<param name="BorderColor" value="2147483654">

<param name="SpecialEffect" value="2">

<param name="Accelerator" value="0">

<param name="GroupName" value>

<param name="FontName" value="MS Sans Serif">

<param name="FontEffects" value="1073741824">

<param name="FontHeight" value="160">

<param name="FontOffset" value="0">

<param name="FontCharSet" value="0">

<param name="FontPitchAndFamily" value="2">

<param name="ParagraphAlign" value="1">

<param name="FontWeight" value="0">

</OBJECT>

<OBJECT ID="ComputerList" Name="ComputerList" WIDTH=140
CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3" height="26">

<param name="VariousPropertyBits" value="746604571">

<param name="BackColor" value="2147483653">

<param name="ForeColor" value="2147483656">

<param name="MaxLength" value="0">

<param name="BorderStyle" value="0">

<param name="ScrollBars" value="0">

<param name="DisplayStyle" value="3">

<param name="MousePointer" value="0">

<param name="Size" value="3704;688">

<param name="PasswordChar" value="0">

<param name="ListWidth" value="0">

<param name="BoundColumn" value="1">

<param name="TextColumn" value="65535">

<param name="ColumnCount" value="1">

<param name="ListRows" value="8">

<param name="cColumnInfo" value="0">

<param name="MatchEntry" value="1">

<param name="ListStyle" value="0">

<param name="ShowDropButtonWhen" value="2">

<param name="ShowListWhen" value="1">

<param name="DropButtonStyle" value="1">

<param name="MultiSelect" value="0">

<param name="Caption" value="Select Computer">

<param name="PicturePosition" value="458753">

<param name="BorderColor" value="2147483654">

<param name="SpecialEffect" value="2">

<param name="Accelerator" value="0">

<param name="GroupName" value>

<param name="FontName" value="MS Sans Serif">

<param name="FontEffects" value="1073741824">

<param name="FontHeight" value="160">

<param name="FontOffset" value="0">

<param name="FontCharSet" value="0">

<param name="FontPitchAndFamily" value="2">

<param name="ParagraphAlign" value="1">

<param name="FontWeight" value="0">

</OBJECT>

<input type="submit" style="font-size: 12pt">

</form>

<br>

<br><br>

<IFRAME Name='compinfo' APPLICATION="yes" SRC="about:blank" WIDTH="60%"
HEIGHT="80%"></IFRAME>

<br>

<script language="vbscript">

<!--

Sub window_OnLoad()

Call GetDomains()

End Sub

//-->

</Script>

</body>

</html>



Tue, 22 Mar 2005 13:59:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to create multifield indexes with AddIndexDef

2. How to use VBA to send Request QueryString to an ASP page

3. Oracle and Delphi 1.0?

4. insufficient key column information

5. Need more Request.QueryString and Request.Form help

6. Can I Request.form and Request.querystring?

7. Request.Querystring problem when using VB Script

8. OnKeyDown redirect problem.

9. Serializing Request.Querystring

10. NameValueCollection, Request.QueryString, WebForm usage

11. For each sKey in Request.QueryString returns Error 451

12. Request.Querystring

 

 
Powered by phpBB® Forum Software