Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 内联标记块(@<;p>;内容<;/p>;)不能嵌套。只允许一级内联标记_Javascript_Asp.net Mvc_Asp.net Mvc 4_Razor_Kendo Ui - Fatal编程技术网

Javascript 内联标记块(@<;p>;内容<;/p>;)不能嵌套。只允许一级内联标记

Javascript 内联标记块(@<;p>;内容<;/p>;)不能嵌套。只允许一级内联标记,javascript,asp.net-mvc,asp.net-mvc-4,razor,kendo-ui,Javascript,Asp.net Mvc,Asp.net Mvc 4,Razor,Kendo Ui,您好,我收到错误信息: Inline markup blocks (@<p>Content</p>) cannot be nested. Only one level of inline markup is allowed. 内联标记块(@Content)不能嵌套。只允许一级内联标记。 使用剑道UI选项卡条和带有Razor视图和MVC4的MultiSelectBox 我已经尝试实现helper类,但仍然会遇到错误 这是我的代码,我是否遗漏了一步?我将3个多选项移出,

您好,我收到错误信息:

Inline markup blocks (@<p>Content</p>) cannot be nested.  Only one level of inline markup is allowed.
内联标记块(@Content

)不能嵌套。只允许一级内联标记。
使用剑道UI选项卡条和带有Razor视图和MVC4的MultiSelectBox

我已经尝试实现helper类,但仍然会遇到错误

这是我的代码,我是否遗漏了一步?我将3个多选项移出,并与助手一起调用它们

@(Html.Kendo().TabStrip()
      .Name("tabstrip")
      .Items(tabstrip =>
      {
          tabstrip.Add().Text("One")                  
              .Content(@<div>                                   
                            @RenderSelect() 
                        </div>;);

          tabstrip.Add().Text("Two")
              .Content("Two");

          tabstrip.Add().Text("Three")
              .Content("Three");
      })
      .SelectedIndex(0)
)

@helper RenderSelect()
{
                                    <h2>MyList</h2>
                                    <label>One</label>
                                    @(Html.Kendo()
                                          .MultiSelect()
                                          .Name("One")
                                          .AutoBind(true)
                                          .Placeholder("Select Clients...")
                                          .DataTextField("hname")
                                          .DataSource(source =>
                                          {
                                              source.Read(read =>
                                              {
                                                  read.Action("Client", "Dist");
                                              })
                                                    .ServerFiltering(true);
                                          })

                                    )
                                    <label>Two</label>
                                    @(Html.Kendo()
                                          .MultiSelect()
                                          .Name("Two")
                                          .AutoBind(true)
                                          .DataTextField("gname")
                                          .Placeholder("Select Recipients...")
                                          .DataSource(source =>
                                          {
                                              source.Read(read =>
                                              {
                                                  read.Action("Client", "Dist");
                                              })
                                                    .ServerFiltering(true);
                                          })

                                          )
                                     <label>Three</label>
                                    @(Html.Kendo()
                                          .MultiSelect()
                                          .Name("Three")
                                          .AutoBind(true)
                                          .DataTextField("id")
                                          .Placeholder("Select CLL...")
                                          .DataSource(source =>
                                          {
                                              source.Read(read =>
                                              {
                                                  read.Action("Codes", "Dist");
                                              })
                                                    .ServerFiltering(true);
                                          })

                                    )
}
@(Html.Kendo().TabStrip())
.名称(“tabstrip”)
.Items(tabstrip=>
{
tabstrip.Add().Text(“一个”)
.Content(@
@RenderSelect()
;);
tabstrip.Add().Text(“两个”)
.内容(“二”);
tabstrip.Add().Text(“三”)
.内容(“三”);
})
.已选择索引(0)
)
@helper RenderSelect()
{
迈利斯特
一个
@(Html.Kendo()
.MultiSelect()
.姓名(“一”)
.AutoBind(真)
.占位符(“选择客户端…”)
.DataTextField(“hname”)
.DataSource(source=>
{
source.Read(Read=>
{
读。行动(“客户”、“地区”);
})
.ServerFiltering(true);
})
)
两个
@(Html.Kendo()
.MultiSelect()
.姓名(“二”)
.AutoBind(真)
.DataTextField(“gname”)
.占位符(“选择收件人…”)
.DataSource(source=>
{
source.Read(Read=>
{
读。行动(“客户”、“地区”);
})
.ServerFiltering(true);
})
)
三
@(Html.Kendo()
.MultiSelect()
.姓名(“三”)
.AutoBind(真)
.DataTextField(“id”)
.占位符(“选择CLL…”)
.DataSource(source=>
{
source.Read(Read=>
{
读。行动(“代码”、“距离”);
})
.ServerFiltering(true);
})
)
}
我想出来了

我得把帮手锁起来

因此,多个选择中的每一个都有一个助手类

遵循以下步骤:

然后,如果希望在一个选项卡中包含多个multiselect,则每个multiselect都需要一个助手,如下所示:

.Items(tabstrip =>
          {
              tabstrip.Add().Text("One")

                  .Content(@<text>
                                                       @RenderMultiSelectFirstBox() 
                                                       @RenderMultiSelectSecondBox()</text>);
这是助手,只需将此复制到第二个、第三个和第四个,并更改名称等

@helper RenderMultiFirstBox()
{
      @(Html.Kendo()
                .MultiSelect()
                .Name("First")
                .AutoBind(true)
                .Placeholder("Select First...")
                .DataTextField("name")
                .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                           read.Action("Index", "Something");
                      })
                 .ServerFiltering(true);
                   })

          )
    }
然后调用选项卡条“内容”中的助手,如下所示:

.Items(tabstrip =>
          {
              tabstrip.Add().Text("One")

                  .Content(@<text>
                                                       @RenderMultiSelectFirstBox() 
                                                       @RenderMultiSelectSecondBox()</text>);
.Items(tabstrip=>
{
tabstrip.Add().Text(“一个”)
.内容(@
@RenderMultiSelectFirstBox()
@RenderMultiSelectSecondBox());