Added a section of jquery code in view to control the Click event of a button. Discovery runtime prompt $ object is not defined, after the browser right-click on the source file discovery, the script code is referencing the jquery code above, when executed jquery has not been introduced, find the template file _layout.cshtml below the page see @rendersection ( "Scripts", Required:false) then goes back to the view file to place the script code in the scope, and eventually the runtime will put the code between @section Scripts to the location of the @rendersection placeholder, so the problem is resolved , I really do not have the experience of MVC, learned before the knowledge also forgotten, only to appear this dilemma. It seems to be a lot more study. Prepare to upgrade your old projects from ASP. NET to MVC.
@{viewdata["Title"] ="Qrlogin";}<BR/><aclass="btn Btn-lg Btn-default"Id="Btnshowqrcode"> get QR code </a>"Imgqrcode"/>@section scripts{<script type="Text/javascript"Language="JavaScript">$ (). Ready (function () {$ ("#imgQRCode"). Hide (); }); </script>}
. NET core into pit experience-3, MVC core jquery is not available?