Jump to content

if then choose a block of html?


narrator
 Share

Recommended Posts

Hi,I'd like to choose between 2 blocks of html, depending on what the variable equals. <if myvar="yes" then>a block of html <else>a different block of html<end if>I've tried coding it a few ways, each time coming up with a syntax error.Your help would be much appreciated :)Thank you

Link to comment
Share on other sites

What version of ASP are you using, and what language are you using to write the code?
From the hosting, it only says asp, asp.net 1.1 and asp.net 2, on IIS 6.0.I could email them and ask for more details if that helps.I'm writing my site in asp and html, with a separate style page.
Link to comment
Share on other sites

Well, if you're using VBScript with ASP classic, or VB.net, here are several examples of control structures:http://www.w3schools.com/VBScript/vbscript_conditionals.aspIf you're using C# with ASP.net, there are examples here:http://msdn.microsoft.com/en-us/library/50...h(v=vs.71).aspxIf you're not sure, the first step is to figure out which language you want to use.

Link to comment
Share on other sites

Well, if you're using VBScript with ASP classic, or VB.net, here are several examples of control structures:http://www.w3schools.com/VBScript/vbscript_conditionals.asp..........If you're not sure, the first step is to figure out which language you want to use.
Thanks just,I looked at that page and experimented a little. What I had trouble with was using the "document.write" part to place dozen or more lines of html.Ideally, I'd like to use "include" statements to put in some default content for both parts of the "if" (unless there's another way achieve this).Cheers
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...