Re: If Statement in HTML



Same grammar we did in CFML, ASP and PHP but different syntax unique to the
scripting language(s) and while nested conditional logic is still supported
in ASP.NET ala <% ... %> most of us dropped that like a bad habit when we
discovered code-behind, web controls, and what are called user controls,
e.g. extensible #include files. Note there are also a number of expression
code blocks that remain in wide use as well as some new expressions for data
binding <%# ... %>.

I'd recommend mastering the page life cycle and the use of web and user
controls. The sooner you learn you are no longer scripting the sooner you
will be able to think using OOP designs and patterns.

Finally, HTML elements are usually referred to as HTML controls in ASP.NET
and are parsed the same way HTML elements are only much later in the page
life cycle. HTML controls can function as web controls when the attribute
pair runat="server" is declared which is why one must assume they are
usually referred to as HTML controls rather than HTML elements.

Being a convert I hope you had sufficient insight to choose C#.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W





"Rick" <rick@xxxxxxxxxxx> wrote in message
news:O4AgcxYxGHA.4632@xxxxxxxxxxxxxxxxxxxxxxx
I am new to ASP.NET I have worked many years in Coldfusion. I am having a
problem finding out how to put an IF Statement into the HTML. How do I do
this in ASP.NET?

Thanks for any help you can give!!!

For example in CF if I want to put an IF Statement I would do something
link this.



<cfif khst.recordcount GT 0>
<tr>
<td class="text">Please Select a City </td>
<td width="181" height="15" align="left"
class="text"><cfselect name="city" query="khcity" value="city"
display="city" queryPosition="below" selected="#city#"
onChange="this.form.submit()">
<option value="PS" selected="selected">Please
Select a City</option>
</cfselect></td>
<cfif city NEQ "Please Select a City">
<td colspan="2" align="left"
class="text">Number of Matches
<cfoutput>#khcityc.recordcount#</cfoutput></td>
<cfelse>
</cfif>
</tr>
</cfif>



.



Relevant Pages

  • IE allows universal Cross Domain Scripting (TL#003)
    ... One of the many elements in HTML 4 is the OBJECT element which is used to ... The object property of embedded WebBrowser controls is not subject to the ... When embedding a document from the same site ... Set "Script ActiveX controls marked safe for scripting" to Prompt or Disable ...
    (Bugtraq)
  • [VulnWatch] IE allows universal Cross Domain Scripting (TL#003)
    ... One of the many elements in HTML 4 is the OBJECT element which is used to ... The object property of embedded WebBrowser controls is not subject to the ... When embedding a document from the same site ... Set "Script ActiveX controls marked safe for scripting" to Prompt or Disable ...
    (VulnWatch)
  • Re: create html from flat file
    ... I want control over the html pages ie ... I was thinking maybe the flat file could use xml. ... a template file to indicate the controls that should appear on each ... create, html, xml, dynamic, template etc results in million+ hits. ...
    (comp.lang.php)
  • Re: create html from flat file
    ... I want control over the html pages ie ... I was thinking maybe the flat file could use xml. ... a template file to indicate the controls that should appear on each ... create, html, xml, dynamic, template etc results in million+ hits. ...
    (comp.lang.php)
  • Re: create html from flat file
    ... I want control over the html pages ie ... I was thinking maybe the flat file could use xml. ... a template file to indicate the controls that should appear on each ... create, html, xml, dynamic, template etc results in million+ hits. ...
    (comp.lang.php)