简体   繁体   中英

MVC Parser Error

I have been working on this page and after restructuring the HTML, I get following error

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The using block is missing a closing "}" character. Make sure you have a matching "}" character for all the "{" characters within this block, and that none of the "}" characters are being interpreted as markup.

Source Error:

Line 43: 
Line 44:                     
Line 45:                         @using (Html.BeginForm("BookingConfirmation", "UserPortal", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" }))
Line 46:                         {
Line 47:                             @Html.HiddenFor(s => s.BookingRequest.BookingInfoId)

Source File: /Views/UserPortal/BookingConfirmation.cshtml    Line: 45 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36415

Here's the page code

@using System.Globalization
@using System.Threading
@using Core.Services.Objects
@using NileSat.App_LocalResources
@model NileSat.Models.NileSatViewModel
@{

    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
@*<section id="content_wrapper">
        <div class="container">
            <div class="row">
                <div class="col-xs-12 text-center">
                    <h1 class="breadTitle">Booking Confirmation</h1>
                </div>
            </div>
        </div>
    </section>*@
<section id="content_wrapper">
    <header id="topbar">
        <div class="topbar-left">
            <ol class="breadcrumb">
                <li class="crumb-icon">
                    <a href="#">
                        <span class="glyphicon glyphicon-home">UserPorta</span>
                    </a>
                </li>
                <li class="crumb-trail">
                    Home
                </li>
            </ol>
        </div>

    </header>
    <div id="content">
        <div class="row">
            <div class="col-md-12 col-md-news">
                <div class="panel panel-visible">
                    <div class="panel-heading">
                        <span class="panel-title">BookingConfirmation</span>
                    </div>


                    <div class="panel-body admin-form">
                        @using (Html.BeginForm("BookingConfirmation", "UserPortal", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" }))
                        {
                            @Html.HiddenFor(s => s.BookingRequest.BookingInfoId)

                            @*<form method="POST" action="@Url.Action("BookingRequest", "UserPortal")">*@
                            @Html.AntiForgeryToken()

                            @*<h2>@Resource.ChannelSearch</h2>*@

                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.Date</label>
                                <div class="col-lg-7">
                                    <label class="form-control">@Html.Label(Model.BookingRequest.RequestDT.Value.Date.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture))</label>
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.Time</label>
                                <div class="col-lg-7">
                                    <label class="form-control">@Html.Label(Model.BookingRequest.RequestDT.Value.ToString("HH:mm:ss", CultureInfo.InvariantCulture))</label>
                                    @Html.HiddenFor(s => s.BookingRequest.RequestDT)
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.RequestNumber</label>
                                <div class="col-lg-7">
                                    <label class="form-control">@Html.Label(Model.BookingRequest.RequestNum.ToString())</label>
                                    @Html.HiddenFor(s => s.BookingRequest.RequestNum)
                                </div>
                            </div>
                            @*<div class="form-group col-lg-6">
                                    <label>@Resource.RequestNumber</label>
                                    @(Html.LabelFor(cs => cs.BookingRequest.RequestNum))

                                </div>*@
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.CompanyName</label>
                                <div class="col-lg-7">
                                    @(Html.TextBoxFor(cs => cs.BookingRequest.CompanyName, new { disabled = "disabled", @class = "form-control" }))
                                    @*@Html.ValidationMessageFor(model => model.BookingRequest.CompanyName, null, new { @class = "contactError" })*@
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.ChannelName</label>
                                <div class="col-lg-7">
                                    @(Html.TextBoxFor(cs => cs.BookingRequest.ChannelName, new { disabled = "disabled", @class = "form-control" }))
                                    @*@Html.ValidationMessageFor(model => model.BookingRequest.ChannelName, null, new { @class = "contactError" })*@
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.AuthorPerson</label>
                                <div class="col-lg-7">
                                    @(Html.TextBoxFor(cs => cs.BookingRequest.AuthorName, new { disabled = "disabled", @class = "form-control" }))
                                    @*@Html.ValidationMessageFor(model => model.BookingRequest.AuthorName, null, new { @class = "contactError" })*@
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.ContactEmail</label>
                                <div class="col-lg-7">
                                    @(Html.TextBoxFor(cs => cs.BookingRequest.ContactEmail, new { disabled = "disabled", @class = "form-control" }))
                                    @*@Html.ValidationMessageFor(model => model.BookingRequest.ContactEmail, null, new { @class = "contactError" })*@
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.ContactPhone</label>
                                <div class="col-lg-7">
                                    @(Html.TextBoxFor(cs => cs.BookingRequest.ContactPhone, new { disabled = "disabled" }))
                                    @*@Html.ValidationMessageFor(model => model.BookingRequest.ContactPhone, null, new { @class = "contactError" })*@
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.ContactFax</label>
                                <div class="col-lg-7">
                                    @(Html.TextBoxFor(cs => cs.BookingRequest.ContactFax, new { disabled = "disabled", @class = "form-control" }))
                                    @*@Html.ValidationMessageFor(model => model.BookingRequest.ContactFax, null, new { @class = "contactError" })*@
                                </div>
                            </div>
                            <div class="form-group col-lg-6">
                                <label class="col-lg-4 control-label">@Resource.ServiceName</label>
                                <div class="col-lg-7">
                                    @(Html.DropDownListFor(cs => cs.BookingRequest.BookingServiceId, //"BookingServiceId",

                                                              new SelectList(Model.BookingServiceTypeViewModels, "Id", "ServiceName"

                                                  , Resource.ServiceName), new { disabled = "disabled" }))@*,Resource.All, new {@title = Resource.ServiceName}*@
                                              , new { @class = "form-control" })
                                            </div>
                                        </div>



                                        <div class="form-cn form-hotel tab-pane active in" id="form-hotel">
                                            <div id="TADiv" style="display: none">
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">Satellite Name</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.SatelliteName, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">Orbital Position</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.OrbitalPosition, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">D/L Freq</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.DLFreq, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">
                                                        Polarization
                                                    </label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.Polarization, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">S.R</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.SR, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">FEC</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.FEC, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">DVBS</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.DVBS, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">DVB S2</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.DVBS2, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                            </div>
                                            <div class="form-group col-lg-6">
                                                <label class="col-lg-4 control-label">Date</label>
                                                <div class="col-lg-7">
                                                    @*@(Html.Kendo().DatePickerFor(cs => cs.BookingRequest.BookingDetails.Date))*@
                                                    <label class="form-control">@(Html.Kendo().DatePickerFor(m => m.BookingRequest.BookingDetails.Date).Enable(false))</label>
                                                    @*@Html.HiddenFor(s => s.BookingRequest.BookingDetails.Date)*@
                                                </div>
                                            <div>


                                                @*<button type="submit" class="button btn-primary" id="btn_AddTime" name="submit" value="AddNewEntry">Add Time</button>*@
                                                @Html.Partial("_RequestTimes", Model)

                                            </div>
                                            <div class="form-group col-lg-6" id="Bw_Div">
                                                <label class="col-lg-4 control-label">BW</label>
                                                <div class="col-lg-7">
                                                    @(Html.DropDownListFor(cs => cs.BookingRequest.BookingDetails.BWRequiredId,
                                              new SelectList(Model.BookingInfoBWViewModels, "Id", "BW"), "None", new { @title = "BW", disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                            <div class="form-group col-lg-6" id="Event_Div">
                                                <label class="col-lg-4 control-label">Event/Conf Name</label>
                                                <div class="col-lg-7">
                                                    @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.EventConfName, new { disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                            <div class="form-group col-lg-6" id="src_Div">
                                                <label class="col-lg-4 control-label">Source</label>
                                                <div class="col-lg-7">
                                                    @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.Source, new { disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                            <div class="form-group col-lg-6" id="Dest_Div">
                                                <label class="col-lg-4 control-label">Destination</label>
                                                <div class="col-lg-7">
                                                    @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.Destination, new { disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                            @*<div class="form-group col-lg-6">
                                                    <label>Destination</label>
                                                    @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.Destination))

                                                </div>*@
                                            <div id="MergeDIV" style="display: none">
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">Channel Name</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.ChannelName, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                            </div>
                                            <div id="SNGDiv" style="display: none">
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">Station Id</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.StationId, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">Station Contact Name</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.StationContactName, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                                <div class="form-group col-lg-6">
                                                    <label class="col-lg-4 control-label">Station Contact Phone</label>
                                                    <div class="col-lg-7">
                                                        @(Html.TextBoxFor(cs => cs.BookingRequest.BookingDetails.StationContactPhone, new { disabled = "disabled", @class = "form-control" }))
                                                    </div>
                                                    </div>
                                            </div>
                                            <div class="form-group col-lg-6" id="encryption_Div">
                                                <label class="col-lg-4 control-label">Encryption</label>
                                                <div class="col-lg-7">
                                                    @(Html.CheckBoxFor(cs => cs.BookingRequest.BookingDetails.IsEncrypted, new { disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                            <div class="form-group col-lg-6">
                                                <label class="col-lg-4 control-label">Other Details</label>
                                                <div class="col-lg-7">
                                                    @(Html.TextAreaFor(cs => cs.BookingRequest.BookingDetails.OtherDetails, new { disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                            <div class="form-group col-lg-6" id="IsAgreed_Div">
                                                <label class="col-lg-4 control-label">Agreement</label>
                                                <div class="col-lg-7">
                                                    @(Html.CheckBoxFor(cs => cs.BookingRequest.BookingDetails.isAgreed, new { disabled = "disabled", @class = "form-control" }))
                                                </div>
                                                </div>
                                        </div>
                                            <div class="form-group col-lg-12">
                                                <div class="col-lg-4">
                                                </div>
                                                <div class="col-lg-7">
                                                    <input type="submit" value="Confirm and Send E-mail" name="submit" class="btn btn-hover btn-danger btn-block pull-right" />
                                                </div>
                                            </div>
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
</section>

<script>
    $('#BookingRequest_BookingServiceId').change(function () {
        debugger;
        // alert('hello');
        var SelectedValue = $(this).val();
        showHideDivs(SelectedValue);
    });
    $(function () {
        debugger;
        var SelectedValue = $('#BookingRequest_BookingServiceId').val();
        showHideDivs(SelectedValue);
    });
    function showHideDivs(SelectedValue) {

        if (SelectedValue == 1) {//feed

            $('#TADiv').hide();
            $('#btn_AddTime').show();
            $('#Bw_Div').show();
            $('#Event_Div').show();
            $('#src_Div').show();
            $('#Dest_Div').show();
            $('#MergeDIV').hide();
            $('#SNGDiv').hide();
            $('#encryption_Div').show();
            $('#IsAgreed_Div').show();
        }
        else if (SelectedValue == 2) {// fiber

            $('#TADiv').hide();
            $('#btn_AddTime').show();
            $('#Bw_Div').hide();
            $('#Event_Div').show();
            $('#src_Div').show();
            $('#Dest_Div').show();
            $('#MergeDIV').hide();
            $('#SNGDiv').hide();
            $('#encryption_Div').hide();
            $('#IsAgreed_Div').show();
        }
        else if (SelectedValue == 3) {//T.A

            $('#TADiv').show();
            $('#btn_AddTime').show();
            $('#Bw_Div').hide();
            $('#Event_Div').hide();
            $('#src_Div').hide();
            $('#Dest_Div').hide();
            $('#MergeDIV').hide();
            $('#SNGDiv').hide();
            $('#encryption_Div').hide();
            $('#IsAgreed_Div').show();
        }
        else if (SelectedValue == 4) { // SNG

            $('#TADiv').hide();
            $('#btn_AddTime').show();
            $('#Bw_Div').show();
            $('#Event_Div').show();
            $('#src_Div').show();
            $('#Dest_Div').show();
            $('#MergeDIV').hide();
            $('#SNGDiv').hide();
            $('#encryption_Div').hide();
            $('#IsAgreed_Div').show();
        }
        else //(SelectedValue == 1)
        {

            $('#TADiv').hide();
            $('#btn_AddTime').hide();
            $('#Bw_Div').hide();
            $('#Event_Div').show();
            $('#src_Div').hide();
            $('#Dest_Div').hide();
            $('#MergeDIV').show();
            $('#SNGDiv').hide();
            $('#encryption_Div').hide();
            $('#IsAgreed_Div').show();
        }
    }
</script>

Can anyone please help find out what I have missed. It could be a div not closed, but I cant find it.

<div class="panel-body admin-form">
    @using (Html.BeginForm("BookingConfirmation", "UserPortal", FormMethod.Post, new {...}))
    {
                        <div class="form-group col-lg-6">
                            <label class="col-lg-4 control-label">Date</label>
                            <!--other code-->
                        <!--Not closing div here-->
    }
</div><!--Date div is mistakenly matching this close tag and leaving close brace inside-->

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM