Reputation:
I am creating a web app in mvc
using Javascript
and Jquery
.
when I comment the line for layout which is below,
//Layout = "~/Views/Shared/myLayout.cshtml";
my ui looks fine in all the mobile devices, but when I un-comment this line like the following,
Layout = "~/Views/Shared/myLayout.cshtml";
my font-size decreases and it makes very difficult to understand,
my myLayout.cshtml is empty
what is the problem here and how can I solve this?
Upvotes: 1
Views: 26
Reputation: 2247
Kindly edit your myLayout.cshtml to
<!DOCTYPE html>
<html lang="en">
<head>
<title>@ViewBag.Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
@RenderBody()
</body>
</html>
Then in your view, remove all the <html>
, <head>
and <body>
tags.
The trick here is <meta>
tag. You can learn more about it here.
Upvotes: 1