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

Discussion in 'ASP .Net' started by erin.sebastian@cowaninsurancegroup.com, Feb 14, 2006.

  1. Guest

    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>
    , Feb 14, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nalla
    Replies:
    25
    Views:
    883
    MikeyD
    Oct 8, 2003
  2. seemanta dutta

    how to make elegant use of preprocessor directives

    seemanta dutta, Nov 27, 2003, in forum: C Programming
    Replies:
    13
    Views:
    637
    Randy Howard
    Dec 1, 2003
  3. IndyChris
    Replies:
    1
    Views:
    8,842
    bruce barker \(sqlwork.com\)
    Aug 9, 2006
  4. Theon Greyjoy

    Preprocessor directives in codebehind file

    Theon Greyjoy, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,527
    bruce barker \(sqlwork.com\)
    Oct 6, 2006
  5. Water Cooler v2

    Preprocessor Directives

    Water Cooler v2, Jul 4, 2005, in forum: C Programming
    Replies:
    5
    Views:
    564
    Lawrence Kirby
    Jul 5, 2005
Loading...

Share This Page