MVC 5 Ajax cascading DropDownList plugin compilation error

627 views Asked by At

I am trying to get the MVC cascading drop down list plugin working. But unfortunately, it does not load the page at all. Does anyone have any idea of what this means, and how I can fix it? It says:

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: CS1520: Method must have a return type

Source Error:

Line 1251: #line default

Line 1252: #line hidden

Line 1253:BeginContext("~/Views/Account/Register.cshtml", 7115, 22, true);

Line 1254:

Line 1255:WriteLiteral(" \r\n\r\n\r\n");

View code:

@using Share.Bonnet.AjaxDropDownList
@model BHSCM.Models.RegisterVendorViewModel
           
@
{
    ViewBag.Title = "Register";
}

@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap") <!—Contains the cascade listbox plugin-->

<!--Body-->
<div class="container">
    <div class="row">

        @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { role = "form" }))
        {
           @Html.AntiForgeryToken()
           <div class="container col-sm-12 blog-post blog-single-post">
                @Html.ValidationSummary("", new { @class = "text-danger" })
                <div class="col-sm-6">
                    <div class="form-group">
…
                        @Html.LabelFor(m => m.Countries, new { @class = "icon-user" })
                        @Html.DropDownListFor(model => model.countryId, Model.Countries, new { @class = "form-control" } },Ajax.UpdateActionFor(model => model.timeZoneID,new AjaxUpdateOptions {DisableTargetWhenEmpty = true,Url = Url.Action("TimeZoneSelectListJson")}))
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.TimeZones, new { @class = "icon-user" })
                        @Html.DropDownListFor(model => model.timeZoneID, Model.TimeZones, new { @class = "form-control", disabled = "disabled" })
…
                    </div>
                    <div class="col-sm-12" style="text-align: right">
                        <hr />
                        <button type="submit" id="btn_Create" class="btn pull-right" value="Register">Register</button>
                    </div>
            </div>
        }
    </div>
</div>

Compiler output errors:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1253,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1253,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1255,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1255,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1257,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1257,12): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1259,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1259,14): error CS1031: Type expected
c:\Users\Alex\Documents\Visual Studio 2013\Projects\BHSCM\BHSCM\Views\Account\Register.cshtml(131,1): error CS1520: Method must have a return type
c:\Users\Alex\Documents\Visual Studio 2013\Projects\BHSCM\BHSCM\Views\Account\Register.cshtml(131,21): error CS1001: Identifier expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1268,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1268,12): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1270,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1270,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1272,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1272,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1274,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1274,12): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1276,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1276,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1278,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1278,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1280,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1280,12): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1282,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1282,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1284,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1284,14): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1300,1): error CS1520: Method must have a return type
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1300,12): error CS1031: Type expected
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b7afd899\b8a95531\App_Web_register.cshtml.5f83eb8c.6mgba5og.0.cs(1304,1): error CS1022: Type or namespace definition, or end-of-file expected

0

There are 0 answers