<% if %> ... <% endif%>

G

Guest

Hi All,

I'm trying to use the <% if %> ... <% endif%> construct in the body of an
aspx page to conditionally display a table row. The table row is displaying
regardless of the condition result in the if construct. Am I doing something
wrong? The code is below:

<%if Test EQ 1%>
<TR>
<TD class="SubHead" noWrap width="1%">1Title:</TD>
<TD class="Normal" colSpan="6">
<asp:TextBox id="ftxtTitle" Width="100%" Runat="server">
</asp:TextBox>
</TD>
</TR>
<%endif%>

Thanks in advance to anyone who knows something about this.
Mark
 
R

Random

Is this a single row you are showing once in the table? Like a header or
footer? I highly recommend you replace the html with either an
asp:DataList, asp:Repeater, or asp:Table (there are other options, but these
would be the top 3 candidates in my opinion). Then, handle your logic
within your server-side code for the various properties of the control
(probably you'll want to play with the Visible and/or Enabled properties).

I've programmed in classic ASP for a long time, so I know how different it
is, but force yourself to get used to the new architecture and I promise, it
will get easier. Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top