Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
ASP Querystring--please help!
Old 05-21-2005, 03:15 AM ASP Querystring--please help!
Junior Talker

Posts: 3
Trades: 0
Hi, I am a new in ASP. And this question has been bothered me for a week-I just could not make it run. Please help me! Here is the question.
A dropdown box which includes "Active" and "Inactive". When I click Active, the URL should be page1.asp?intactive=1 (this is my thought which I am not sure if it is correct.), and it will upload all active list in this page.
************************************************** *****
Dim intActive, cnnApp, cmdApp, rstApp
intActive = request.querystring("intActive")

<Script Language=JavaScript>
function Status(intActive)
{
if (intActive == "1")
window.document.frmStatus.action="page1.asp?intact ive=1";
else
window.document.frmStatus.action="page1.asp?intact ive=0";
}
</Script>

<form name="frmStatus" method="post">
Please select: <select name="intActive" onChange="Status(this)">
<option value="1">Active</option>
<option value="0"> Inactive</option>
</select>
<input name="submit" type="submit" value="submit" >

</form>
************************************************** **

Or I tried do If statment with connection but not working:
*************************************************
if (intActive == "1") Then

Set cnnApp = OpenDB()
Set cmdApp = Server.CreateObject("ADODB.Command")
With cmdApp
.ActiveConnection = cnnApp
.CommandType = adCmdStoredProc
.CommandText = "sel_activelist"
Set rstApp = .Execute
End With

Set rstApp.ActiveConnection = Nothing
CloseDB cnnApp
Set cmdApp = Nothing
end if
************************************************** **
if I can use IF with connection DB, how do I do with inactive list?

Please help me! I really have no clue for it. Thanks so much!

lonestar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-21-2005, 04:46 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
form method "post" sends the values in the form collection, Use request.form("name") to retrieve

are you using ASP JScript or vBScript?

because this;
Code:
Dim intActive, cnnApp, cmdApp, rstApp
intActive = request.querystring("intActive")
is vBScript

while this;
Code:
if (intActive == "1") Then
is almost JScript

You can't mix the two on one page.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-21-2005, 05:37 PM
Junior Talker

Posts: 3
Trades: 0
Thank you for your reply. I am using Java Script. Can you tell me how to fix the code? Please help.
lonestar is offline
Reply With Quote
View Public Profile
 
Old 05-21-2005, 06:21 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
which bit?

The client side form code (in javascript) or the server side code which is a hybrid of JScript and vBScript.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to ASP Querystring--please help!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20022 seconds with 12 queries