klundby
klundby

Reputation: 300

The 'model' keyword must be followed by a type name on the same line

I get an exception saying "The 'model' keyword must be followed by a type name on the same line" when i try to load my page.

QuickTimingSpeakerInfo.Controllers.BracketWidgetModel is a class.

in the cshtml file i have the following:

@model QuickTimingSpeakerInfo.Controllers.BracketWidgetModel

<script type="text/javascript">
    $(document).ready(function () {
        $("#SettingsMenuButton-" + '@model.Guid').button({
            icons: {
                primary: "ui-icon-circle-arrow-w"
            },
            text: false
        })
        .click(function () {
            ChooseWidgetInitialize(@Model.TabId, @Model.WidgetId, @Model.EventUID);
        });
    });
</script>...

It was working only a short moment ago. Rebuilding does not solve it. How do i resolve this?

Upvotes: 1

Views: 1835

Answers (1)

klundby
klundby

Reputation: 300

The problem is that I used @model.field instead of @Model.field. The error message points to fist line and not the actual line the error was on.

Upvotes: 2

Related Questions