简体   繁体   中英

Expected expression visual studio warning in javascript and razor

What is visual studio complaining about here? 在此输入图像描述

Code

    PoolsGrid = Ext.extend(SearchableGrid, {
    initComponent: function() {
        var me = this;
        var config = {
            url: @(Url.ParameterlessRelativeTemplate<PoolsController>(x => x.List(null)))
        }
    }
});

More code:

    public static IHtmlString ParameterlessRelativeTemplate<TController>(this UrlHelper url,
                                                                          Expression<Action<TController>> action)
        where TController : Controller
    {
        return RelativeTemplate(url, action, true);
    }

The code looks fine. Ignore the error and run your application ( Ctrl+F5 ). It should work fine. Visual Studio Intellisense in Razor views is far from perfect. Hopefully they will improve it in future versions.

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