Re: If Statement in HTML
- From: "clintonG" <csgallagher@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 21 Aug 2006 21:08:42 -0500
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>
.
- Follow-Ups:
- Re: If Statement in HTML
- From: Rick
- Re: If Statement in HTML
- References:
- If Statement in HTML
- From: Rick
- If Statement in HTML
- Prev by Date: Building Multilingual e-Commerce Portal: Components & Costs?
- Next by Date: Put ASP .NET Web Form Data Into a .PDF file
- Previous by thread: Re: If Statement in HTML
- Next by thread: Re: If Statement in HTML
- Index(es):
Relevant Pages
|