This is a migrated thread and some comments may be shown as answers.

Partial View in Pane

6 Answers 239 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paulo de Tarso
Top achievements
Rank 1
Paulo de Tarso asked on 09 Mar 2011, 03:48 PM
Hi,
My _Layout.cshtml has a splitter (Razor).
I put a Partial View in a Pane but not working.
Below the code ..


_Layout.cshtml
@{Html.Telerik().Splitter().Name("Splitter")
            .Orientation(SplitterOrientation.Horizontal)
            .Panes(hPanes =>
            {
                hPanes.Add()
                    .Size("200px")
                    .MinSize("100px")
                    .MaxSize("300px")
                    .Collapsible(true)
                    .Scrollable(false)
                    .Content(() =>
                    {
                        Html.Telerik().Splitter()
                            .Name("NestedSplitter")
                            .HtmlAttributes(new { style = "height: 100%; border: 0;" })
                            .Orientation(SplitterOrientation.Vertical)
                            .Panes(vPanes =>
                            {
                                vPanes.Add()
                                    .Content(() =>
                                    {
                                        @Html.Partial("_MenuLateral");  //  <<<---- Don't Work
                                    });

                                vPanes.Add()
                                    .Size("70px")
                                    .MinSize("60px")
                                    .MaxSize("150px")
                                    .Content("<p style='text-align: center; padding: .5em;'>Select a view from the list above.</p>");
                            })
                            .Render();
                    });

                hPanes.Add()
                    .Scrollable(false)
                    .Content(() =>
                    {
                        @RenderBody();
                    });
            })
            .Render();
            }

Partial View (_MenuLateral.cshtml)
---------------
@(
  Html.Telerik().PanelBar()
  .Name("PanelBar")
  .HighlightPath(true)
  .Items(item =>
         {
          item.Add()
          .Text("Sistema")
          .ImageHtmlAttributes(new { alt = "Sistema" })
          .Items(subItem =>
                  {
                   subItem.Add()
                     .Text("Sobre")
                     .Action("Grid", "Elemento", new { id = "05.1"});
                   subItem.Add()
                     .Text("Trocar Usuário")
                     .Action("Grid", "Elemento", new { id = "03.1" });
                  }
                )
         }
        )
    .ExpandMode(0)
  )

What's wrong?

tks

Paulo

6 Answers, 1 is accepted

Sort by
0
jinal
Top achievements
Rank 1
answered on 19 Mar 2011, 05:32 AM
Hi,

I am also facing same issue. Actually partialview working view with ASPX view engine. I think this is problem related to Razor View. I also faced same issue with TabStrip with razor.

I just tried with Html.RenderPartial in Razor view and its working. Please try with Html.RenderPartial instead of Html.Partial.. I know that it is against Razor..but..


Please provide some suggestion...
0
nachid
Top achievements
Rank 1
answered on 19 Mar 2011, 10:44 AM
There is a difference between the two

  • @Html.Partial("ViewName")
  • @Html.RenderPartial("ViewName");

Paulo,
Just remove the ; from the end of @Html.Partial("_MenuLateral");  //  <<<---- Don't Work
and change it to @Html.Partial("_MenuLateral")  //  <<<---- Should Work
0
Accepted
jinal
Top achievements
Rank 1
answered on 19 Mar 2011, 02:15 PM
@Html.Partial("ViewName") gives error and asking for ";" at the end of statement.
0
Doel
Top achievements
Rank 1
answered on 29 Mar 2011, 10:37 PM
I am having the sam issue. anyone has a solution?

Thank you
0
Gunnar
Top achievements
Rank 1
answered on 19 May 2011, 10:58 AM
Try this (works for me)

.Content(

@<text>

@Html.Partial(

 

"_TextAnalysis")

 

 

</text>

 

);

0
Accepted
DATEL
Top achievements
Rank 1
answered on 14 Jul 2011, 04:06 PM
Gunnar, that worked for me also.  Thanks!
Tags
Splitter
Asked by
Paulo de Tarso
Top achievements
Rank 1
Answers by
jinal
Top achievements
Rank 1
nachid
Top achievements
Rank 1
Doel
Top achievements
Rank 1
Gunnar
Top achievements
Rank 1
DATEL
Top achievements
Rank 1
Share this question
or