ASP.NET Web Pages 2 Developer Preview ReadMe
by Microsoft
ASP.NET Web Pages 2 Developer Preview ReadMe
14 September 2011
Contents
Installation Notes
To install Web Pages 2 Developer Preview, you have these options:
Install WebMatrix 2 Beta using the Web Platform Installer. WebMatrix is a set of free web development tools that includes ASP.NET Web Pages. For more information, see the installation section in The Top Features in ASP.NET Web Pages 2 Developer Preview.
Install Web Pages 2 Developer Preview directly using the download link. Use this approach if you want to create Web Pages applications using a text editor such as Notepad. In order to run Web Pages 2 applications, you must have IIS Express 7.5. (This is included automatically with WebMatrix.) For tips on how to test a Web Pages page using IIS Express, see the sidebar “Creating and Testing ASP.NET Pages Using Your Own Text Editor” in Getting Started with WebMatrix and ASP.NET Web Pages.
ASP.NET Web Pages 2 Developer Preview can be installed and can run side-by-side with ASP.NET Web Pages 1. For details, see the section “Running Web Pages Applications Side-by-Side” in The Top Features in Web Pages 2 Developer Preview.
Documentation
Tutorials and other information about ASP.NET Web Pages are available on the Web Pages page of the ASP.NET website (https://www.asp.net/web-pages/). For information about new features and enhancements in Web Pages 2, see The Top Features in Web Pages 2 Developer Preview.
Support
This is a preview release and is not officially supported. If you have questions about working with this release, post them to the ASP.NET Web Pages forum (https://forums.asp.net/1224.aspx/1?WebMatrix ), where members of the ASP.NET community are frequently able to provide informal support.
Software Requirements
ASP.NET Web Pages 2 requires the .NET Framework 4. It also works with the .NET Framework 4.5 Developer Preview release.
Fixes, Known Issues, and Breaking Changes
- Is* methods (for example, IsDateTime) now return correct values for all cultures. Some methods like IsDateTime previously returned false when they should have returned true because they were previously performing culture-specific checks. These methods have been fixed to now take culture into account. This is a breaking change; if your application relies on the old behavior, it will break.
The behavior of the Href method has changed. Previously, calling Href(“/SomeFile“) would return a URL relative to the currently executing file. Now Href(”/SomeFile”) always returns an absolute path from the root of the application. For most cases, this behavior won’t make a difference in the return value. This change was made to fix certain Ajax scenarios. For example, consider the following example code:
[!code-cshtmlMain]
1: /Folder/File
2: @Href("~/Images/Logo.jpg")
- The HttpContext.RedirectLocal method has changed. This method now accepts only URLs that are relative to the current application. Fully qualified URLs are rejected.
The ModelState.IsValid method now requires you to call Validate first. If you are converting your application to use the new input validation methods and are calling the ModelState.IsValid method, you must now call Validation.Validate beforehand. For example, you must now follow this pattern:
[!code-csharpMain]
1: Validation.RequireField("MyField");
2: if (IsPost) {
3: Validation.Validate();
4: if (ModelState.IsValid) {
5: // do something
6: }
7: }
However, we recommend that if you use the new input validation methods, don’t use ModelState.IsValid. Instead, structure your code like this:
[!code-csharpMain]
1: Validation.RequireField("MyField");
2: if (IsPost) {
3: if (Validation.IsValid()) {
4: // do something
5: }
6: }
- On Internet Explorer 7 and Internet Explorer 8, client-side validation does not work. Client-side validation does not work due to incompatibilities with jQuery 1.6.2, which is included with the default project template. (Server-side validation works.).
Disclaimer
© 2011 Microsoft Corporation. All rights reserved. This document is provided “as-is.” Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it.
|