asp.net mvc的初学

0.参考资料:http://www.cnblogs.com/Leeyong/archive/2010/10/19/1855526.html

                 http://www.cnblogs.com/Leeyong/archive/2010/10/29/1864358.html

1. 调用不同的 控制器,控制器里的方法,不过要依靠的URL 默认的 URL 是 /Controller/ActionName/Parameters  就是 控制器/方法/参数

     http://localhost:5653/HelloWorld/Index

2.   Server.HTMLEncode用法!!

Server.HTMLEncode

HTMLEncode

一.HTMLEncode 方法对指定的字符串应用 HTML 编码。

语法

Server.HTMLEncode( string )

参数

 

string
指定要编码的字符串。

示例

脚本

<%= Server.HTMLEncode("The paragraph tag: <P>") %>

输出

The paragraph tag: &lt;P&gt;

注意 以上输出将被 Web 浏览器显示为

The paragraph tag: <P>

如果查看一下源文件或以文本方式打开一个 Web 页,您就可以看到已编码的 HTML

3. Unable to update the EntitySet because it has a DefiningQuery and no element exists in the element to support the current operation 错误的解决:

   因为创建表的时候没有设置主键。。。。。。参见:http://www.developer2blog.com/post/2012/05/10/Unable-to-update-the-EntitySet-because-it-has-a-DefiningQuery-and-no-element-exists-in-the-element-to-support-the-current-operation.aspx

 

 

转载于:https://www.cnblogs.com/gorgeous1314/archive/2012/07/18/2597236.html

猜你喜欢

转载自blog.csdn.net/weixin_34050005/article/details/93431845