Jump to content

if then choose a block of html?


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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...