1

I have some issues with displaying content of partial view to w2ui layout's panel. I'm trying to do it with such way

@: $().w2layout({@: name: 'layout@(string.Format("{0}{1}", panelNamesList.IndexOf(item), HelperForViewPart.htmlPlusSpaceExcepter(layoutId)))',
    @: panels: [
        foreach(var subitem in item) {
            switch (item.IndexOf(subitem)) {
                case 0:
                    @: {
                        type: 'left',
                        resizable: true,
                        style: pstyle,
                        size: '33%',
                        minSize: '200',
                        content: '@html.Action(actionName, controllerName, new {parameter = subitem, taskName = layoutId}) '
                    },
                    break;
                case 1:
                    @: {
                        type: 'main',
                        resizable: true,
                        style: pstyle,
                        size: '33%',
                        minSize: '200',
                        content: '@html.Action(actionName, controllerName, new {parameter = subitem, taskName = layoutId}) '
                    },
                    break;
                case 2:
                    @: {
                        type: 'right',
                        resizable: true,
                        style: pstyle,
                        size: '33%',
                        minSize: '200',
                        content: '@html.Action(actionName, controllerName, new {parameter = subitem, taskName = layoutId}) '
                    }
                    break;
            }
        }@:
    ]@:
});

this part of JavaScript located inside cshtml file. And it works but not correctly, cause @Html.Action methods returns part of html which created by razor and it contains things like line breaks ("\n") and whitespaces, so js can't understand what I want, does anybody have some ideas?

Amit Joki
  • 58,320
  • 7
  • 77
  • 95
zuzman322
  • 124
  • 8

0 Answers0