Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 18th, 2005, 06:26 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use "if statment'' inside asp script

I want pass some values by get method to an asp script and i want that script to make decison based on value it passed. What i mean run diffrent block of html and query for each diffirent value passed for it. I be happy if some one show me an exmaple .Thanks



 
Old March 18th, 2005, 07:15 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can use something like

<% if request("field_name") = 1 then %>
SHOW CONTENT 1
<%else%>
SHOW CONTENT 2
<%end if%>


Om Prakash
 
Old March 18th, 2005, 07:30 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by om_prakash
 You can use something like

<% if request("field_name") = 1 then %>
SHOW CONTENT 1
<%else%>
SHOW CONTENT 2
<%end if%>


Om Prakash

Thanks for u reply. could i user nested if too. i mean more then
one selctin like 6?
 
Old March 21st, 2005, 01:47 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Yes you can use more than one condition.

You can use case statement as well..

select case Field_Name

case 1
   'Show something..
case 2
   'Show something..
.
.
.
.
.
end select

Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access ASP code inside Javascript deean JSP Basics 1 June 20th, 2008 02:00 PM
generating javascript arguments inside ASP script cookster Classic ASP Professional 0 November 24th, 2007 03:56 PM
asp inside js crmpicco Classic ASP Basics 2 July 6th, 2005 09:49 PM
ASP variable inside my JavaScript crmpicco Javascript How-To 1 June 4th, 2005 12:17 AM
include php inside the asp file karib Classic ASP Databases 2 November 25th, 2003 03:51 PM





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