ASP.NET MVC 简介
这个是在网上找的一个关于ASP.NET MVC 的定义,我觉得已经解释的够好了,所以就借过来用用了 ,呵呵
希望有心学习ASP.NET MVC 的朋友先熟悉定义,在后续的文章中会更轻松的学习ASP.NET MVC
下面我们一起踏上ASP.NET MVC 之旅吧,只要有恒心和毅力,祝学者们旅途愉快!
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace.
MVC is a standard design pattern that many developers are familiar with. Some types of Web applications will benefit from the MVC framework. Others will continue to use the traditional ASP.NET application pattern that is based on Web Forms and postbacks. Other types of Web applications will combine the two approaches; neither approach excludes the other.
MVC架构模式将应用程序分为模型-视图-控制器三个主要组织部分,ASP.NET MVC框架提供一种可以代替ASP.NET Web Forms模式来创建基于MVC的应用程序,ASP.NET MVC是轻量级的,高可测试的框架,并且可以结合现有的ASP.NET的特性如母板、基于membership的身份验证,MVC框架基础定义在System.Web.Mvc命名空间中的,成为System.Web命名空间的一部分。
MVC作为一个标准的设计模式被广大的开发人员所熟知。某些类型的Web应用程序将受益于MVC framework。其它类型的应用程序可以继续使用传统的基于Postbacks的Web forms模式进行ASP.NET开发,也可以结合这两种模式,它们是并行存在而不是互相冲突的。
The MVC framework includes the following components:
MVC框架包含如下组成部分:
Models. Model objects are the parts of the application that implement the logic for the application's data domain. Often,
相关文档:
启动页面缓存,代码如下:
<%OutputCache Duration="60" VaryByParam="*"%>
说明:
Duration必需属性。页面被缓存旱,以秒为单位,且必须是整数。
Location 指定应输出进行缓存的位置。参数是以下选项之一:Any,Client,Downstream,None,Server,ServerAndClient
VaryByParam 必需属性。Request中变量 ......
做网站与搞安全一般都离不开权限分配,网站权限一般都直接设置站点所在的虚拟目录的,也就是在虚拟目录的安全里添加internet来宾账户,并分配除完全控制外的所有权限;如果是.NET,还必须给ASP.NET用户配置除完全控制以外的权限!
一般情况下,这样就OK了,服务器上的一般网站都可以正常运行了!但现在我发现:C\WINDOWS ......
ASP.NET文件下载函数使用是什么情况呢?在你的Page_Load中添加这样的代码:
Page.Response.Clear();
bool success = ResponseFile(Page.Request, Page.Response, "目的文件名称", @"源文件路径", 1024000);
if (!success) Response.Write("下载文件出错!"); Page.Response.End();
ASP.NET文件下载函数代码为:
......
string destFileName = "ok.txt";
destFileName = Server.MapPath(".") + "\\"+destFileName;
destFileName = Server.UrlDecode(destFileName);
&nbs ......
1.获取Return返回值
程序代码//存储过程
//Create PROCEDURE MYSQL
// @a int,
// @b int
//AS
// return @a + @b
//GO
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToStri ......