0

I have creating my website using composite c1 .net cms with razor master template. but I can't able to render the script in the masterlayout.Here is my razor files.

1.MaserLayout.cshtml

@inherits CompositeC1WebPage
@{
    string websiteTitle = HomePageNode.Title;
}
    <!DOCTYPE html>
      <html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="@Lang">
            <head>
                <title>@CurrentPageNode.Title</title>
                @if (!string.IsNullOrEmpty(CurrentPageNode.Description))
                {
                <meta name="description" content="@CurrentPageNode.Description" />
                }
                @PageTemplateFeature("Descriptive HTML head elements")
            </head>
            <body>

                <div class="container-fluid main-container">
                    @* renders the sub template: *@
                    @RenderBody()
                </div>
            </body>
        </html>

above is my master template and here is my home template

@inherits RazorPageTemplate
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    @*you can add template specific head elements here*@
</head>
<body class="frontpage">
    <div>Test template</div>
    <script>

        $(document).ready(function () {
            $('.test').click(function () {
                alert("test");
            })
        });
    </script>
</body>
</html>

But I can't able to run the script in the masterpage.Cn anyone help.

Thanks in advance for help.

Arun
  • 1,402
  • 10
  • 32
  • 59

1 Answers1

0

If Composit-c1 uses some special razor functionality/flow other than default then please ignore this comment

I think it's not related to composit-c1 razor, you should define layout in home page to use master page. & also any script is not defined in you master pages.

in derived pages you don't create complete DOM structure (html, head & body etc. tags)

syed Ahsan Jaffri
  • 1,160
  • 2
  • 14
  • 34