473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dynamic case statement

Tom
I would like to know if an .asp case statement can contain HTML elements. I
am building an application that I would like to have dynamic choices. The
dynamic part would be built in the a case statment that will output based
upon the value of the option evaluated. This example only shows one case
statement but there are eight case statements.
Thanks for any insight!
Tom
If Not objRs.EOF Then
Do While Not objRs.EOF

Select Case mvar
Case 2
<TABLE BORDER=0 WIDTH=700;">
<TR>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>Extra Comments</TD>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>Include in Month
End Report</TD>
</TR>
<TR>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>
<INPUT type=text value=1 name=test1></TD>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>
<INPUT TYPE="RADIO" NAME="test2" VALUE="IncludeMonthEnd" /></TD>
</TR>
</TABLE>

<!--> Missing record processing in each case statement and the balance of
the eight case statements -->
objRs.MoveNext
Loop
End If
Jul 19 '05 #1
2 2348
<%
mvar = request.querystring("mvar")
If mvar = 2 then
%>
<table border=1><tr><td><font color=blue>Some
text</font></td></tr></table>
<%
elseif mvar = 1 then
%>
<table border=1><tr><td><font color=red>Some
text</font></td></tr></table>
<%
else
%>
<table border=1><tr><td><font color=green>Some
text</font></td></tr></table>
<%
end if
%>
--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Tom <to*********@abercrombienospamkent.com> wrote in message
news:OE*************@TK2MSFTNGP11.phx.gbl...
I would like to know if an .asp case statement can contain HTML elements. I am building an application that I would like to have dynamic choices. The
dynamic part would be built in the a case statment that will output based
upon the value of the option evaluated. This example only shows one case
statement but there are eight case statements.
Thanks for any insight!
Tom
If Not objRs.EOF Then
Do While Not objRs.EOF

Select Case mvar
Case 2
<TABLE BORDER=0 WIDTH=700;">
<TR>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>Extra Comments</TD> <TD align="left" vAlign="top" WIDTH="50%" colSpan=2>Include in Month
End Report</TD>
</TR>
<TR>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>
<INPUT type=text value=1 name=test1></TD>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>
<INPUT TYPE="RADIO" NAME="test2" VALUE="IncludeMonthEnd" /></TD>
</TR>
</TABLE>

<!--> Missing record processing in each case statement and the balance of
the eight case statements -->
objRs.MoveNext
Loop
End If

Jul 19 '05 #2
Tom wrote:
I would like to know if an .asp case statement can contain HTML
elements. I am building an application that I would like to have
dynamic choices. The dynamic part would be built in the a case
statment that will output based upon the value of the option
evaluated. This example only shows one case statement but there are
eight case statements.
Thanks for any insight!
Tom

You either have to response.write the html strings, or end the server-side
script blocks at the appropriate locations:

either
select case mvar
Case 2
Response.write "<TABLE BORDER=0 WIDTH=700>"
etc.

or
select case mvar
Case 2
%>
<TABLE BORDER=0 WIDTH=700;">
<TR>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>Extra Comments</TD>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>Include in Month
End Report</TD>
</TR>
<TR>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>
<INPUT type=text value=1 name=test1></TD>
<TD align="left" vAlign="top" WIDTH="50%" colSpan=2>
<INPUT TYPE="RADIO" NAME="test2" VALUE="IncludeMonthEnd" /></TD>
</TR>
</TABLE>
<%
Case 3
%>
etc.

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October...
2
by: Richard | last post by:
Hi all, I had a stored procedure that i wanted to be able to pass parameters to so i used dynamic SQL. I am getting very strange errors though when i try to execute it. My code works just fine,...
9
by: mooseshoes | last post by:
All: I'm using Access 2000 on a Windows XP platform. My goal is to use a form to gather user criteria which I will then parse into a useable SQL string. At this point I would like to open one...
4
by: Zark3 | last post by:
Hi all, I was wondering if anybody could enlighten me on the possibility of dynamic casting. Or, well, whether or not I'm actually trying to do this the right way. What I have is a base class...
1
by: letmatros | last post by:
Hi, I have a fairly simple select statement, but I want to do pagination and the sort order should be controlled by the user. The last part is causing me problems... I use DB2 8.2.3 on Windows. My...
1
by: Pacific Fox | last post by:
Hi all, I have a SQL statement that allows paging and dynamic sorting of the columns, but what I can't figure out without making the SQL a dynamic string and executing it, or duplicating the SQL...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
6
by: =?ISO-8859-1?Q?Tim_B=FCthe?= | last post by:
Hi, we are building a Java webapplication using JSF, running on websphere, querying a DB2 9 on Suse Enterprise 10. The app uses JDBC and PreparedStatements only (aka dynamic SQL). Every night,...
2
by: Damir | last post by:
Hello! I have noticed that after (sucessfully) executing the command: FLUSH PACKAGE CACHE DYNAMIC the dynamic SQL statement cache is not completely cleared (some of the dynamic SQL statement...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.