@RenderBody () with canvas

I have a canvas uploaded to _Layout.cshtml

When I look at the Index, About, or Contacts page, <canvas> displayed, but the contents of the page are missing.

Index page will load the div under the <body> , but the About page is missing.

I assume that @RenderBody not in the corresponding z-index or does not appear on top of <canvas> , as my index page does.

 <canvas id="bgCanvas"></canvas> <script src="~/Scripts/starLayout.js"></script> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now</p> </footer> </div> 

edit2:

in view mode is displayed

  <canvas id="bgCanvas"></canvas> <script src="/Scripts/starLayout.js"></script> <div class="container body-content"> <h2>About.</h2> <h3>Your application description page.</h3> <div> <p>Use this area to provide additional information.</p> </div> <hr /> <footer> <p>&copy; 4/17/2015 11:33:17 AM - JTR</p> </footer> </div> 

However, I still do not see the content so that it is under the canvas that I believe in. Which is strange, since it is on top of the canvas on index.cshtml

+6
source share
1 answer

Here is your answer: w3c canvas . Soon you should provide width and height properties for the canvas element.

And don't forget to put the * .js / code file that is responsible for the "drawing" after the canvas element.

Can you provide css code so that I will better edit this answer to be more specific?

0
source

Source: https://habr.com/ru/post/985366/


All Articles