468,115 Members | 2,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

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("CreationDate", "{0:f}")+"</span><br
/><span style=\"Text-Align:Center\">"+Eval("Description") + "</span>"
%>'></asp:Label>

I get this error when trying to run the page:

C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Eternity Records(VB)\WebRoot\index.aspx(13) : error BC32017:
Comma, ')', or a valid expression continuation expected.
Nov 19 '08 #1
3 3383
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("CreationDate", "{0:f}")+"</span><br
/><span style=\"Text-Align:Center\">"+Eval("Description") + "</span>"
%>'></asp:Label>

I get this error when trying to run the page:

C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Eternity Records(VB)\WebRoot\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("CreationDate", "{0:f}") %>
</span><br/>
<span style="Text-Align:Center"><%# Eval("Description") %></span>

Hans Kesting
Nov 20 '08 #2
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" <ne*********@spamgourmet.comwrote in message
news:uW**************@TK2MSFTNGP02.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("CreationDate", "{0:f}")+"</span><br
/><span style=\"Text-Align:Center\">"+Eval("Description") + "</span>"
%>'></asp:Label>

I get this error when trying to run the page:

C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Eternity Records(VB)\WebRoot\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("CreationDate", "{0:f}") %>
</span><br/>
<span style="Text-Align:Center"><%# Eval("Description") %></span>

Hans Kesting


Nov 20 '08 #3
"Andy B" <a_*****@sbcglobal.netwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>I get this error when trying to run the page:

C:\Documents and Settings\Andy\My Documents\Visual Studio
2008\Projects\Eternity Records(VB)\WebRoot\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:
http://www.google.co.uk/search?sourc...cape+character
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 20 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mike Fisher | last post: by
7 posts views Thread by Matthew Del Buono | last post: by
reply views Thread by Rich | last post: by
2 posts views Thread by Roger Wang | last post: by
7 posts views Thread by Mark Carrington | last post: by
reply views Thread by Ken | last post: by
4 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.