Error: End of statement expected.

Posted on 2011-04-26
Last Modified: 2012-05-11
The Code is outlined below. I get error point toward this line: " <%: Html.ActionLink("New Task", "Create")%> "

<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage((Of SimpleRMCI_TM.Models.Task)(Of SimpleRMCI_TM.Controllers.TaskFormViewModel)(Of SimpleRMCI_TM.Helpers.PaginatedList))" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>All Tasks</h2>

    <%: Html.ActionLink("New Task", "Create")%>

            <%= Html.DropDownList("TaskStatusList")%>

        <% For Each item In Model%>
        <%= Html.ActionLink(item.TaskID, "Details", New With {.id = item.TaskID})%>
        <%= Html.Encode(item.TaskName.ToString())%>
        <%= Html.Encode(item.InsertDateTime.ToString())%>
        <% Next%>
    <%  If (Model.HasPreviousPage) Then%>

    <%= Html.RouteLink("<<<", "Tasks", New With {.page = (Model.PageIndex - 1)})%>

    <% End If%>

    <%  If (Model.HasNextPage) Then%>

    <%= Html.RouteLink(">>>", "Tasks", New With {.page = (Model.PageIndex + 1)})%>

    <% End If%>  
Question by:patelankitm
    LVL 17

    Expert Comment

    change this
    <%: Html.ActionLink("New Task", "Create")%>

    to this

    <%= Html.ActionLink("New Task", "Create")%>

    Author Comment

    Same Error.
    LVL 11

    Expert Comment

    Correct, for more information on the binding shortcuts they are explained here:
    LVL 11

    Expert Comment

    Nope, no matter how long I look at it I can't find fault with xDJR1875 solution.

    Accepted Solution

    The problem is solved by removing this line: (Of SimpleRMCI_TM.Controllers.TaskFormViewModel)

    Author Closing Comment

    Removing the reference to the view model.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now