Preprocessor directives must appear as the first non-whitespace character on a line

E

erin.sebastian

Hello All ( I posted this on another group and was directed to post
this here so here goes)

I am writing a webpage in c+ .net and i have a repeater that displays
information, i want to add a statement that says
IF ("title" value from databinder == "Careers") output BLAH (show the
stuff in the databind)
ELSE
output some other BLAH (redirect to a different ASPX but show the
"title" field from the databinder...

but i keep getting the above (in the subject line) error and i can't
figure out why.. can anyone help me out...

(go to the --RIGHT HERE-- tag to see what i've done)..

Thanks in advance!!

<asp:Repeater id="rptSectionDetS" Visible="False" runat="server"
onItemDataBound="ShowSubSections">
<ItemTemplate>
<li <%#
validSec(DataBinder.Eval(Container.DataItem,
"sectionId").ToString()) ? "class='current'" : " class=''" %>><a
href="section<%# DataBinder.Eval(Container.DataItem, "layoutId")
%>.aspx?id=<%# DataBinder.Eval(Container.DataItem, "sectionId") %>"><%#
DataBinder.Eval(Container.DataItem, "title") %></a></li>

<asp:Repeater
id="rptSubSections" Visible='<%#
validSec(DataBinder.Eval(Container.DataItem, "sectionId").ToString())
%>' runat="server" onItemDataBound="ShowSubPages">
<ItemTemplate>
<li <%#
validSubSec(DataBinder.Eval(Container.DataItem,
"subsectionId").ToString()) ? "class='level1hl'" : " class='level1'"
%>>
--RIGHT
HERE-- <% if(# DataBinder.Eval(Container.DataItem,
"title").ToString() != "Careers"}{%>

<a href="subsection<%#
DataBinder.Eval(Container.DataItem,
"layoutId") %>.aspx?id=<%# DataBinder.Eval(Container.DataItem,
"subsectionId") %>"><%# DataBinder.Eval(Container.DataItem, "title")
%></a></li>

<%}%> -- ADD ELSE EVENTUALLY--


<asp:Repeater id="rptSubPages" Visible='<%#
(validSubSec(DataBinder.Eval(Container.DataItem,
"subsectionId").ToString())) %>' runat="server">

<ItemTemplate>

<li class="level2"><a href="subpage<%#
DataBinder.Eval(Container.DataItem, "layoutId") %>.aspx?id=<%#
DataBinder.Eval(Container.DataItem, "subpageid") %>"><%#
DataBinder.Eval(Container.DataItem, "title") %></a></li>

</ItemTemplate>

</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top