本文介绍了刷新MVC4应用程序,刷新页面并获取异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Create a MVC 4 web application and in home page  (Index.cshtml) add
Under this line
Under <h3>We suggest the following</h3>
Add this line
<canvas id="HelloCanvas" style="float: left" > </canvas>

Under this declaration
@{
    ViewBag.Title = "Home Page";
}
Now add this script

<script>
    window.onload = function () {
       var LineContext = $('#HelloCanvas')[0].getContext('2d');
        LineContext.font = "20pt Calibri";
        LineContext.fillStyle = "#024F8C";
        LineContext.textAlign = "left";
        LineContext.textBaseline = "middle";
        LineContext.fillText("Hello world", 0, 10);
        LineContext.save();
    }
</script>

Run this application and you will see "Hello world"  Text.
Now refresh this page from address bar and you will get exception. I spent whole day but no success. Any help will be very much appreciated.

推荐答案




这篇关于刷新MVC4应用程序,刷新页面并获取异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 16:45