locked
Invalid expression term '=' with "Wingtip Toys" and VS15 RRS feed

  • Question

  • User779668004 posted

    I am new to ASP.NET. I am going through the Tutorial "Wingtip Toys" using VS 15.

    While building I get the following error.

    C:\Users\PTRKR\AppData\Local\Temp\Temporary ASP.NET Files\root\c1ba113e\f370489c\App_Web_iqrtwucl.1.cs(2005,58): error CS1525: Invalid expression term '='
    C:\Users\PTRKR\AppData\Local\Temp\Temporary ASP.NET Files\root\c1ba113e\f370489c\App_Web_iqrtwucl.1.cs(2006,42): error CS1002: ; expected
    C:\Users\PTRKR\Documents\Visual Studio 2015\Projects\Wingtip Toys\Wingtip Toys\Site.Master(90,22): error CS1525: Invalid expression term '='

    Can anyone help me with solution to come over this problem?

    I noticed that the word Item is underlined in Site.Master file:

    <ItemTemplate>
    <b style="font-size: large; font-style: normal">
    <a href="/~ProductList.aspx?id=<%# Item.CategoryID %>">
    <%# Item.CategoryName %>
    </a>
    </b>
    </ItemTemplate>

    Thanks in advance.

    Rajagopalan P. T

    Tuesday, May 1, 2018 1:48 PM

All replies

  • User283571144 posted

    Hi RAJAGOPALAN P T,

    According to your description, I have downloaded the Wingtip Toys demo application from asp.net  web form tutorial. It works well.

    Link:https://code.msdn.microsoft.com/Getting-Started-with-221c01f5?cdn_id=2013-12-16-001

    According to demo application master page codes, I found you faced the word Item is underlined in a listview.

    I guess you may not set the ItemType of that listview or use the wrong itemtype, so you faced this error.

    I suggest you could try below codes:

           <div id="CategoryMenu" style="text-align: center">       
                <asp:ListView ID="categoryList"  
                    ItemType="WingtipToys.Models.Category" 
                    runat="server"
                    SelectMethod="GetCategories" >
    <ItemTemplate>
    <b style="font-size: large; font-style: normal">
    <a href="/~ProductList.aspx?id=<%# Item.CategoryID %>">
    <%# Item.CategoryName %> 
    </a>
    </b>
    </ItemTemplate>
                    <ItemSeparatorTemplate>  |  </ItemSeparatorTemplate>
                </asp:ListView>
            </div>

    If this solution doesn't solve your issue, I suggest you could post the details codes about your master page and viewed aspx page.

    If you could post more details information and codes, it will be more easily for us to find the solution.

    Best Regards,

    Brando

    Wednesday, May 2, 2018 8:18 AM