compiler failed with error code 1.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy B

    compiler failed with error code 1.

    I have the following code:

    <asp:Label ID="Label1" runat="server" Text='<%# "<h2
    style=\"Text-Align:Center\"> "+Eval("Title") +"</h2><br /><span
    style=\"Text-Align:Center\"> "+Eval("Creatio nDate", "{0:f}")+"</span><br
    /><span style=\"Text-Align:Center\"> "+Eval("Descrip tion") + "</span>"
    %>'></asp:Label>

    I get this error when trying to run the page:

    C:\Documents and Settings\Andy\M y Documents\Visua l Studio
    2008\Projects\E ternity Records(VB)\Web Root\index.aspx (13) : error BC32017:
    Comma, ')', or a valid expression continuation expected.


  • Hans Kesting

    #2
    Re: compiler failed with error code 1.

    After serious thinking Andy B wrote :
    I have the following code:
    >
    <asp:Label ID="Label1" runat="server" Text='<%# "<h2
    style=\"Text-Align:Center\"> "+Eval("Title") +"</h2><br /><span
    style=\"Text-Align:Center\"> "+Eval("Creatio nDate", "{0:f}")+"</span><br
    /><span style=\"Text-Align:Center\"> "+Eval("Descrip tion") + "</span>"
    %>'></asp:Label>
    >
    I get this error when trying to run the page:
    >
    C:\Documents and Settings\Andy\M y Documents\Visua l Studio
    2008\Projects\E ternity Records(VB)\Web Root\index.aspx (13) : error BC32017:
    Comma, ')', or a valid expression continuation expected.
    Your directoryname ("Eternity Records(VB)") seems to suggest that you
    use VB. Is \" in VB an escape for "just a quote"? (It *is* in C#).

    Do you need to have everything in a single <asp:label>? Or could you
    split this expression: have all the Eval's in separate blocks and move
    the fixed strings outside the databinding block.

    Sort of:
    <h2 style="Text-Align:Center">< %# Eval("Title") %></h2><br />
    <span style="Text-Align:Center">< %#Eval("Creatio nDate", "{0:f}") %>
    </span><br/>
    <span style="Text-Align:Center">< %# Eval("Descripti on") %></span>

    Hans Kesting


    Comment

    • Andy B

      #3
      Re: compiler failed with error code 1.

      That is how it needs to be done. Everything has to be inside the label
      control and done inside the markup. I don't know what the escape character
      for vb is... anybody know?


      "Hans Kesting" <news.hansdk@sp amgourmet.comwr ote in message
      news:uW0AdYxSJH A.5860@TK2MSFTN GP02.phx.gbl...
      After serious thinking Andy B wrote :
      >I have the following code:
      >>
      ><asp:Label ID="Label1" runat="server" Text='<%# "<h2
      >style=\"Text-Align:Center\"> "+Eval("Title") +"</h2><br /><span
      >style=\"Text-Align:Center\"> "+Eval("Creatio nDate", "{0:f}")+"</span><br
      >/><span style=\"Text-Align:Center\"> "+Eval("Descrip tion") + "</span>"
      >%>'></asp:Label>
      >>
      >I get this error when trying to run the page:
      >>
      >C:\Documents and Settings\Andy\M y Documents\Visua l Studio
      >2008\Projects\ Eternity Records(VB)\Web Root\index.aspx (13) : error
      >BC32017: Comma, ')', or a valid expression continuation expected.
      >
      Your directoryname ("Eternity Records(VB)") seems to suggest that you use
      VB. Is \" in VB an escape for "just a quote"? (It *is* in C#).
      >
      Do you need to have everything in a single <asp:label>? Or could you split
      this expression: have all the Eval's in separate blocks and move the fixed
      strings outside the databinding block.
      >
      Sort of:
      <h2 style="Text-Align:Center">< %# Eval("Title") %></h2><br />
      <span style="Text-Align:Center">< %#Eval("Creatio nDate", "{0:f}") %>
      </span><br/>
      <span style="Text-Align:Center">< %# Eval("Descripti on") %></span>
      >
      Hans Kesting
      >
      >

      Comment

      • Mark Rae [MVP]

        #4
        Re: compiler failed with error code 1.

        "Andy B" <a_borka@sbcglo bal.netwrote in message
        news:%236iGa5xS JHA.3300@TK2MSF TNGP02.phx.gbl. ..
        >>I get this error when trying to run the page:
        >>>
        >>C:\Document s and Settings\Andy\M y Documents\Visua l Studio
        >>2008\Projects \Eternity Records(VB)\Web Root\index.aspx (13) : error
        >>BC32017: Comma, ')', or a valid expression continuation expected.
        >>
        >Your directoryname ("Eternity Records(VB)") seems to suggest that you use
        >VB. Is \" in VB an escape for "just a quote"? (It *is* in C#).
        >>
        >Do you need to have everything in a single <asp:label>? Or could you
        >split this expression: have all the Eval's in separate blocks and move
        >the fixed strings outside the databinding block.
        >
        That is how it needs to be done. Everything has to be inside the label
        control and done inside the markup. I don't know what the escape character
        for VB.NET is... anybody know?
        GIYF:



        --
        Mark Rae
        ASP.NET MVP


        Comment

        Working...