locked
Compiler Error Message: CS1518 in a view RRS feed

  • Question

  • User-1126397820 posted

    I'm getting the follwoing error message in my index view

    <title>Compilation Error</title> <mce:style><!-- body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } --></mce:style><mce:style mce_bogus="1"><!-- body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } --></mce:style><mce:style mce_bogus="1"><!-- body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } --></mce:style><style mce_bogus="1"><!-- body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } --></style>

    Server Error in '/' Application.

    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: CS1518: Expected class, delegate, enum, interface, or struct

    Source Error:

    Line 7:  <%@ Import Namespace="MvcContrib.Pagination" %>
    Line 8:  <%@ Import Namespace="MvcContrib.UI.Grid.ActionSyntax" %>
    Line 9:  <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    Line 10:     <%
    Line 11:         if (User.IsInRole("Administrator") || User.IsInRole("AdPressSales"))

    Using code segment -

    <%@ Page Title="CCC Company List Index" Language="C#" MasterPageFile="~/Views/Shared/Ccc.Master" Inherits="System.Web.Mvc.ViewPage<IPagination<Project.Models.CccCompany>>" %>
    
    <%@ Import Namespace="Project.Helpers" %>
    <%@ Import Namespace="MvcContrib.UI.Pager" %>
    <%@ Import Namespace="MvcContrib.UI.Grid" %>
    <%@ Import Namespace="MvcContrib.Pagination" %>
    <%@ Import Namespace="MvcContrib.UI.Grid.ActionSyntax" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
        <% Html.Grid(Model)
            .Columns(column =>




    This code was working and something broke and I really don't see where the problem is.


    thanks in advance

    Tom

    Saturday, July 25, 2009 11:45 AM

Answers

  • User1677479917 posted

    Hi,

    Line 11 was missing one opening bracket

    if ((User.IsInRole("Administrator") || User.IsInRole("AdPressSales"))



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 25, 2009 12:24 PM

All replies

  • User1677479917 posted

    Hi,

    Line 11 was missing one opening bracket

    if ((User.IsInRole("Administrator") || User.IsInRole("AdPressSales"))



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 25, 2009 12:24 PM
  • User-1126397820 posted

    Thanks, that did turn out to be the problem.  Tracing down brace problems in view is the one thing I really do not care for in mvc.

    Saturday, July 25, 2009 5:46 PM