locked
Compiler Error Message: BC30203: Identifier expected. RRS feed

  • Question

  • User41597897 posted

    I am getting the following error when opening a my web page that is trying to display an image in a webpage:

    Compilation Error              Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.            
    Compiler Error Message: BC30203: Identifier expected.
    Source Error:

    Line 376:					</HeaderTemplate>
    Line 377:					<ItemTemplate>
    Line 378:						<img src="data:image/jpg;base64,<%# Eval("Image") != System.DBNull.Value ? Convert.ToBase64String((byte[])Eval("Image")) : string.Empty %>" alt="image" height="50" width="50" />
    Line 379:					</ItemTemplate>
    Line 380:				</asp:templatefield>
                      

    Source File: d:\hosting\tazd7777\Team_Play\VBA2K\VBA2KPlayers.aspx               Line:  378   

             

    Monday, March 10, 2014 1:08 AM

Answers

  • User1208776063 posted

    src="data:image/jpg;base64,<%# Eval("Image") != System.DBNull.Value ? Convert.ToBase64String((byte[])Eval("Image")) : string.Empty %>"

    I don't think there is any error with that condition. But, you should not use double quotes when you have <%#Eval()%> inside the attribute. Try replacing double quotes with single quotes and see if it works. 

    <img src='data:image/jpg;base64,<%# Eval("Image") != System.DBNull.Value ? Convert.ToBase64String((byte[])Eval("Image")) : string.Empty %>' 
            alt="image" height="50" width="50" />
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 10, 2014 1:20 AM