3

我想知道我是否可以做到这一点,或者有其他方法可以做到吗?我构建它没有问题,但是当我运行它时它说:

CS1660:无法将 lambda 表达式转换为类型“DevExpress.Web.Mvc.RoundPanelSettings”,因为它不是委托类型

代码:

@Html.DevExpress().RoundPanel(RPsettings =>
{
    RPsettings.Name = "rpnlNewUpdateConfigs";
    RPsettings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
    RPsettings.ShowHeader = false;
    RPsettings.SetContent(() =>
        {
            Html.DevExpress().CallbackPanel(CBsettings =>
            {
                CBsettings.Name = "cbpnlNewUpdateConfigs";
                CBsettings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
                CBsettings.CallbackRouteValues = new { Controller = "Storage", Action = "Storage" };
                CBsettings.SetContent(() =>
                    {
                        @<table>
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>&nbsp;
                                            </td>
                                            <td>Type:
                                            </td>
                                            <td>
                                                @Html.DevExpress().ComboBox(cboxsettings =>
                                                {
                                                    cboxsettings.Name = "cbType";
                                                    cboxsettings.Width = 180;
                                                    cboxsettings.SelectedIndex = -1;
                                                    cboxsettings.Properties.ValueType = typeof(string);
                                                    cboxsettings.Properties.Items.Add("Path");
                                                }).GetHtml();
                                            </td>
                                            <td>&nbsp;
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>;
                        Html.DevExpress().Label(L1settings =>
                        {
                            L1settings.Name = "ErrorLabel1";
                            L1settings.Text = "Label1";
                        }).Render();
                        Html.DevExpress().Label(L2settings =>
                        {
                            L2settings.Name = "ErrorLabel2";
                            L2settings.Text = "Label2";
                        }).Render();
                    });
            }).GetHtml();
        });
}).GetHtml()

有什么猜测吗?

4

1 回答 1

2

发现发生了什么。这种方式在 SetContent() 中不允许使用 asp.net 标记。正确的做法是:

CBsettings.SetContent(() => {
    ViewContext.Writer.Write("<h1>Hello World</h1>");

    ...

});

可悲的是,智能感知并没有给出错误的线索。

于 2013-06-05T18:45:32.487 回答