Visual Studio Web Developer Express中的条件编译已关闭错误

时间:2012-02-09 01:03:36

标签: c# javascript asp.net-mvc razor

我在控制器中使用ViewBag传递二维数据数组,如下所示:

ViewBag.CountryArray = PopulateCountryArray(CountriesInContinent);

然后,在视图中,我有:

<script type="text/javascript">
    function PopulateCountries() 
    {
         // Copy the country-continent data from Viewbag to local a array.
         var arraylength =
            @Html.Raw(Json.Encode(ViewBag.CountryArray.Length()));
         var CountryArray =
            @Html.Raw(Json.Encode(ViewBag.CountryArray));
...

我收到了这篇帖子标题中引用的错误,在“Html”出现的情况下都有一条绿色的波浪线。

基本上,我只想将Controller中C#中的二维数组传递给View中定义的Javascript函数。

最好的方法是什么,摆脱这些错误?

0 个答案:

没有答案
相关问题