asp.net core mvc项目

时间: 2023-02-08 13:25:37 浏览: 126
ZIP

asp-net-core-mvc

ASP.NET Core MVC是微软推出的一种用于构建Web应用程序的框架,它是基于ASP.NET Core构建的,提供了一组用于构建Web应用程序的工具和技术。它采用了MVC(Model-View-Controller)架构模式,将应用程序的业务逻辑、数据和用户界面分离开来,使得代码更加清晰、可维护。
阅读全文

相关推荐

application/x-dosexec
AspNetMVC2_RC_VS2008.exe ASP.NET MVC 2 Release Candidate Release Notes This document describes the Release Candidate release of the ASP.NET MVC 2 framework. Installation Notes 2 Documentation 2 Support 2 Upgrading an ASP.NET MVC 1.0 Project to ASP.NET MVC 2 2 New Features 3 ASP.NET MVC validation scripts have been moved to their own file 4 ASP.NET MVC validation scripts can be included at the top or bottom of a page 4 ASP.NET MVC validation scripts support globalization 4 Html.ValidationSummary helper method can display model-level errors 4 T4 templates in Visual Studio generate code that is specific to the target version of the .NET Framework 4 Other Improvements 4 Bug Fixes 5 Breaking Changes 5 Changes in ASP.NET MVC 2 Release Candidate 5 Changes in ASP.NET MVC 2 Beta 6 Changes in ASP.NET MVC 2 Preview 2 6 Changes in ASP.NET MVC 2 Preview 1 7 Known Issues 7 Disclaimer 8 This document describes the Release Candidate release of ASP.NET MVC 2 for Visual Studio 2008 SP1. Installation Notes The ASP.NET MVC 2 Release Candidate for Visual Studio 2008 SP1 can be downloaded from the following page: http://go.microsoft.com/fwlink/?LinkID=157071 ASP.NET MVC 2 can be installed and can run side-by-side with ASP.NET MVC 1.0. Note   Because Visual Studio 2008 and Visual Studio 2010 Beta 2 share a component of ASP.NET MVC 2, installing the ASP.NET MVC 2 Release Candidate release on a computer where Visual Studio 2010 Beta 2 is also installed is not supported. Documentation Documentation for ASP.NET MVC 2, which includes tutorials, technology overviews, code samples, and API reference, is available on the MSDN Web site. A good starting point is the ASP.NET Model View Controller (MVC) topic (http://go.microsoft.com/fwlink/?LinkId=159758). Tutorials and other information about ASP.NET MVC are also available on the ASP.NET Web site (http://www.asp.net/mvc/). Support This is a Release Candidate (RC) release and is not officially supported. If you have questions about working with this release, post them to the ASP.NET MVC forum (http://forums.asp.net/1146.aspx), where members of the ASP.NET community are frequently able to provide informal support. Upgrading an ASP.NET MVC 1.0 Project to ASP.NET MVC 2 To upgrade an existing ASP.NET MVC 1.0 application to version 2, follow these steps: Make a backup of the existing project. Open the project file in a text editor (the file with the .csproj or .vbproj file extension) and find the ProjectTypeGuid element. As the value of that element, replace the GUID {603c0e0b-db56-11dc-be95-000d561079b0} with {F85E285D-A4E0-4152-9332-AB1D724D3325}. When you are done, the value of that element should be as follows: {F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} In the Web application root folder, edit the Web.config file. Search for System.Web.Mvc, Version=1.0.0.0 and replace all instances with System.Web.Mvc, Version=2.0.0.0. Repeat the previous step for the Web.config file located in the Views directory. Open the project using Visual Studio, and in Solution Explorer, expand the References node. Delete the reference to System.Web.Mvc (which points to the version 1.0 assembly). Add a reference to System.Web.Mvc (v2.0.0.0). Add the following bindingRedirect element to the Web.config file in the application root under the configuraton section: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> Create a new ASP.NET MVC 2 application. Copy the files from the Scripts directory of the new application into the Scripts directory of the existing application. Compile the application and run it. If any errors occur, refer to the Breaking Changes section of this document for possible solutions. New Features This section describes features that have been introduced in the ASP.NET MVC 2 Release Candidate release. ASP.NET MVC validation scripts have been moved to their own file To help reduce conflicts with other Ajax libraries, the built-in ASP.NET MVC validation scripts are now in a separate JavaScript file. ASP.NET MVC validation scripts can be included at the top or bottom of a page The server component that renders the client validation metadata now renders the metadata into a JavaScript variable. This allows the validation scripts to be included either at the top of the page or at the bottom, because the scripts will look for the variable and load the metadata when it is available. ASP.NET MVC validation scripts support globalization When the required ASP.NET Ajax globalization scripts are included in a page, the validation logic uses the culture-specific data for data types (such as dates and numbers) when it validates input text. The new Html.GlobalizationScript helper method can be used to render a reference to the globalization script for the current culture. Html.ValidationSummary helper method can display model-level errors Instead of always displaying all validation errors, the Html.ValidationSummary helper method has a new option to display only model-level errors. This enables model-level errors to be displayed in the validation summary and field-specific errors next to each field. T4 templates in Visual Studio generate code that is specific to the target version of the .NET Framework A new property is available to T4 files from the ASP.NET MVC T4 host that specifies the version of the .NET Framework that is used by the application. This allows T4 templates to generate code and markup that is specific to a version of the .NET Framework. In Visual Studio 2008, the value is always .NET 3.5. In Visual Studio 2010, the value is either .NET 3.5 or .NET 4. Other Improvements The following additional changes have been made to existing types and members for the ASP.NET MVC 2 Release Candidate release. The default HTML markup that is generated by the Add View dialog box has been changed to be consistent with the markup that is rendered by the templated helpers (Editor, EditorFor, Display, and DisplayFor). Buttons in a form can specify that they do not cause validation logic to run. The default is that every button in a form causes validation logic to run, and if validation fails, the validation logic blocks submission of the form. Enabling validation selectively for buttons lets you create forms that can post information even if a form is not complete or if the form contains data that is temporarily invalid. Client validators can specify when they run. Possible values are input (while the user is typing), blur (after the user is done typing and moves to another field), and submit (when the user submits the form). Bug Fixes The following bugs have been fixed in the ASP.NET MVC 2 Release Candidate release. The FileResult action result now supports non-US-ASCII characters in file names. Methods and properties of the TempDataDictionary class have been improved to better handle the case when items are flagged for removal from the dictionary. Support for validation in the IDataErrorInfo interface has been fixed. Breaking Changes The following changes might cause errors in existing ASP.NET MVC 1.0 applications. Changes in ASP.NET MVC 2 Release Candidate IIS script mapping script is no longer available in the installer The IIS script mapping script is a command-line script that is used to configure script maps for IIS 6 and for IIS 7 in Classic mode. The script-mapping script is not needed if you use the Visual Studio Development Server or if you use IIS 7 in Integrated mode. The scripts are available as a separate unsupported download on the ASP.NET CodePlex site. The Html.Substitute helper method in MVC Futures is no longer available Due to changes in the rendering behavior of MVC view engines, the Html.Substitute helper method does not work and has been removed. Changes in ASP.NET MVC 2 Beta The IValueProvider interface replaces all uses of IDictionary<string, ValueProviderResult> Every property or method argument that accepted IDictionary<string, ValueProviderResult> now accepts IValueProvider. This change affects only applications that include custom value providers or custom model binders. Examples of properties and methods that are affected by this change include the following: The ValueProvider property of the ControllerBase and ModelBindingContext classes. The TryUpdateModel methods of the Controller class. New CSS classes were added in the Site.css file that are used to style validation messages. Changes in ASP.NET MVC 2 Preview 2 Helpers now return an MvcHtmlString object In order to take advantage of the new HTML-encoding expression syntax in ASP.NET 4, the return type for HTML helpers is now MvcHtmlString instead of a string. Note that if you use ASP.NET MVC 2 and the new helpers with ASP.NET 3.5, you will not be able to take advantage of the HTML-encoding syntax; the new syntax is available only when you run ASP.NET MVC 2 on ASP.NET 4. JsonResult now responds only to HTTP POST requests In order to mitigate JSON hijacking attacks that have the potential for information disclosure, by default, the JsonResult class now responds only to HTTP POST requests. Ajax GET calls to action methods that return a JsonResult object should be changed to use POST instead. If necessary, you can override this behavior by setting the new JsonRequestBehavior property of JsonResult. For more information about the potential exploit, see the blog post JSON Hijacking on Phil Haack’s blog. Model and ModelType property setters on ModelBindingContext are obsolete A new settable ModelMetadata property has been added to the ModelBindingContext class. The new property encapsulates both the Model and the ModelType properties. Although the Model and ModelType properties are obsolete, for backward compatibility the property getters still work; they delegate to the ModelMetadata property to retrieve the value. Changes in ASP.NET MVC 2 Preview 1 Changes to the DefaultControllerFactory class break custom controller factories that derive from it The DefaultControllerFactory class was fixed by removing the RequestContext property. In place of this property, the request context instance is passed to the protected virtual GetControllerInstance and GetControllerType methods. This change affects custom controller factories that derive from DefaultControllerFactory. Custom controller factories are often used to provide dependency injection for ASP.NET MVC applications. To update the custom controller factories to support ASP.NET MVC 2, change the method signature or signatures to match the new signatures, and use the request context parameter instead of the property. “Area” is a now a reserved route-value key The string “area” in Route values now has special meaning in ASP.NET MVC, in the same way that “controller” and “action” do. One implication is that if HTML helpers are supplied with a route-value dictionary containing “area”, the helpers will no longer append “area” in the query string. If you are using the Areas feature, make sure to not use {area} as part of your route URL. Known Issues Adding a debugger watch that shows a value from TempData will mark it for deletion. The side effect was introduced as part of the changes to TempDataDictionary. Disclaimer This is a preliminary document and may be changed substantially prior to final commercial release of the software described herein. The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place or event is intended or should be inferred. © 2009 Microsoft Corporation. All rights reserved. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

最新推荐

recommend-type

asp.net core mvc实现文件上传实例

在ASP.NET Core MVC中,文件上传是一个常见的功能,用于接收用户通过网页选择并发送到服务器的文件。在本文中,我们将深入探讨如何实现一个简单的文件上传实例。 首先,我们需要创建一个控制器来处理文件上传的逻辑...
recommend-type

ASP.NET Core MVC 中实现中英文切换的示例代码

在ASP.NET Core MVC中实现中英文切换主要是利用.NET Core框架提供的全球化(Globalization)和本地化(Localization)功能。这些功能允许开发者为应用程序创建多语言支持,以满足不同地区用户的语言需求。以下是一个...
recommend-type

asp.net core项目mvc权限控制:分配权限

在本教程中,我们将探讨如何在ASP.NET Core MVC项目中实现这一功能,特别是如何进行权限的分配。 首先,权限控制通常涉及三个核心实体:用户、角色和权限。用户是系统中的个体,角色是一组权限的集合,而权限则定义...
recommend-type

ASP.NET Core集成微信登录

主要介绍了ASP.NET Core集成微信登录的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
recommend-type

asp.net core mvc权限控制:在视图中控制操作权限

ASP.NET Core MVC 权限控制是构建安全Web应用程序的关键部分,它允许开发者限制对特定功能或数据的访问,确保只有具备相应权限的用户才能执行特定操作。本文将深入探讨如何在视图层实现这一控制。 在ASP.NET Core ...
recommend-type

探索数据转换实验平台在设备装置中的应用

资源摘要信息:"一种数据转换实验平台" 数据转换实验平台是一种专门用于实验和研究数据转换技术的设备装置,它能够帮助研究者或技术人员在模拟或实际的工作环境中测试和优化数据转换过程。数据转换是指将数据从一种格式、类型或系统转换为另一种,这个过程在信息科技领域中极其重要,尤其是在涉及不同系统集成、数据迁移、数据备份与恢复、以及数据分析等场景中。 在深入探讨一种数据转换实验平台之前,有必要先了解数据转换的基本概念。数据转换通常包括以下几个方面: 1. 数据格式转换:将数据从一种格式转换为另一种,比如将文档从PDF格式转换为Word格式,或者将音频文件从MP3格式转换为WAV格式。 2. 数据类型转换:涉及数据类型的改变,例如将字符串转换为整数,或者将日期时间格式从一种标准转换为另一种。 3. 系统间数据转换:在不同的计算机系统或软件平台之间进行数据交换时,往往需要将数据从一个系统的数据结构转换为另一个系统的数据结构。 4. 数据编码转换:涉及到数据的字符编码或编码格式的变化,例如从UTF-8编码转换为GBK编码。 针对这些不同的转换需求,一种数据转换实验平台应具备以下特点和功能: 1. 支持多种数据格式:实验平台应支持广泛的数据格式,包括但不限于文本、图像、音频、视频、数据库文件等。 2. 可配置的转换规则:用户可以根据需要定义和修改数据转换的规则,包括正则表达式、映射表、函数脚本等。 3. 高度兼容性:平台需要兼容不同的操作系统和硬件平台,确保数据转换的可行性。 4. 实时监控与日志记录:实验平台应提供实时数据转换监控界面,并记录转换过程中的关键信息,便于调试和分析。 5. 测试与验证机制:提供数据校验工具,确保转换后的数据完整性和准确性。 6. 用户友好界面:为了方便非专业人员使用,平台应提供简洁直观的操作界面,降低使用门槛。 7. 强大的扩展性:平台设计时应考虑到未来可能的技术更新或格式标准变更,需要具备良好的可扩展性。 具体到所给文件中的"一种数据转换实验平台.pdf",它应该是一份详细描述该实验平台的设计理念、架构、实现方法、功能特性以及使用案例等内容的文档。文档中可能会包含以下几个方面的详细信息: - 实验平台的设计背景与目的:解释为什么需要这样一个数据转换实验平台,以及它预期解决的问题。 - 系统架构和技术选型:介绍实验平台的系统架构设计,包括软件架构、硬件配置以及所用技术栈。 - 核心功能与工作流程:详细说明平台的核心功能模块,以及数据转换的工作流程。 - 使用案例与操作手册:提供实际使用场景下的案例分析,以及用户如何操作该平台的步骤说明。 - 测试结果与效能分析:展示平台在实际运行中的测试结果,包括性能测试、稳定性测试等,并进行效能分析。 - 问题解决方案与未来展望:讨论在开发和使用过程中遇到的问题及其解决方案,以及对未来技术发展趋势的展望。 通过这份文档,开发者、测试工程师以及研究人员可以获得对数据转换实验平台的深入理解和实用指导,这对于产品的设计、开发和应用都具有重要价值。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

ggflags包的国际化问题:多语言标签处理与显示的权威指南

![ggflags包的国际化问题:多语言标签处理与显示的权威指南](https://www.verbolabs.com/wp-content/uploads/2022/11/Benefits-of-Software-Localization-1024x576.png) # 1. ggflags包介绍及国际化问题概述 在当今多元化的互联网世界中,提供一个多语言的应用界面已经成为了国际化软件开发的基础。ggflags包作为Go语言中处理多语言标签的热门工具,不仅简化了国际化流程,还提高了软件的可扩展性和维护性。本章将介绍ggflags包的基础知识,并概述国际化问题的背景与重要性。 ## 1.1
recommend-type

如何使用MATLAB实现电力系统潮流计算中的节点导纳矩阵构建和阻抗矩阵转换,并解释这两种矩阵在潮流计算中的作用和差异?

在电力系统的潮流计算中,MATLAB提供了一个强大的平台来构建节点导纳矩阵和进行阻抗矩阵转换,这对于确保计算的准确性和效率至关重要。首先,节点导纳矩阵是电力系统潮流计算的基础,它表示系统中所有节点之间的电气关系。在MATLAB中,可以通过定义各支路的导纳值并将它们组合成矩阵来构建节点导纳矩阵。具体操作包括建立各节点的自导纳和互导纳,以及考虑变压器分接头和线路的参数等因素。 参考资源链接:[电力系统潮流计算:MATLAB程序设计解析](https://wenku.csdn.net/doc/89x0jbvyav?spm=1055.2569.3001.10343) 接下来,阻抗矩阵转换是
recommend-type

使用git-log-to-tikz.py将Git日志转换为TIKZ图形

资源摘要信息:"git-log-to-tikz.py 是一个使用 Python 编写的脚本工具,它能够从 Git 版本控制系统中的存储库生成用于 TeX 文档的 TIkZ 图。TIkZ 是一个用于在 LaTeX 文档中创建图形的包,它是 pgf(portable graphics format)库的前端,广泛用于创建高质量的矢量图形,尤其适合绘制流程图、树状图、网络图等。 此脚本基于 Michael Hauspie 的原始作品进行了更新和重写。它利用了 Jinja2 模板引擎来处理模板逻辑,这使得脚本更加灵活,易于对输出的 TeX 代码进行个性化定制。通过使用 Jinja2,脚本可以接受参数,并根据参数输出不同的图形样式。 在使用该脚本时,用户可以通过命令行参数指定要分析的 Git 分支。脚本会从当前 Git 存储库中提取所指定分支的提交历史,并将其转换为一个TIkZ图形。默认情况下,脚本会将每个提交作为 TIkZ 的一个节点绘制,同时显示提交间的父子关系,形成一个树状结构。 描述中提到的命令行示例: ```bash git-log-to-tikz.py master feature-branch > repository-snapshot.tex ``` 这个命令会将 master 分支和 feature-branch 分支的提交日志状态输出到名为 'repository-snapshot.tex' 的文件中。输出的 TeX 代码使用TIkZ包定义了一个 tikzpicture 环境,该环境可以被 LaTeX 编译器处理,并在最终生成的文档中渲染出相应的图形。在这个例子中,master 分支被用作主分支,所有回溯到版本库根的提交都会包含在生成的图形中,而并行分支上的提交则会根据它们的时间顺序交错显示。 脚本还提供了一个可选参数 `--maketest`,通过该参数可以执行额外的测试流程,但具体的使用方法和效果在描述中没有详细说明。一般情况下,使用这个参数是为了验证脚本的功能或对脚本进行测试。 此外,Makefile 中提供了调用此脚本的示例,说明了如何在自动化构建过程中集成该脚本,以便于快速生成所需的 TeX 图形文件。 此脚本的更新版本允许用户通过少量参数对生成的图形进行控制,包括但不限于图形的大小、颜色、标签等。这为用户提供了更高的自定义空间,以适应不同的文档需求和审美标准。 在使用 git-log-to-tikz.py 脚本时,用户需要具备一定的 Python 编程知识,以理解和操作 Jinja2 模板,并且需要熟悉 Git 和 TIkZ 的基本使用方法。对于那些不熟悉命令行操作的用户,可能需要一些基础的学习来熟练掌握该脚本的使用。 最后,虽然文件名称列表中只列出了 'git-log-to-tikz.py-master' 这一个文件,但根据描述,该脚本应能支持检查任意数量的分支,并且在输出的 TeX 文件中使用 `tikzset` 宏来轻松地重新设置图形的样式。这表明脚本具有较好的扩展性和灵活性。"