随笔分类 - Asp.net mvc 3
摘要:http://www.cnblogs.com/duanshuiliu/p/3696087.html
阅读全文
摘要:1. jQuery.post $.post("/Control/Action", { "id": recordToDelete },function (data) { //回调函数});
阅读全文
摘要:ASP.NET MVC中实现多个按钮提交的几种方法
阅读全文
摘要:javascript跳转页面:Javascript实现页面跳转的几种方式收藏 : http://apps.hi.baidu.com/share/detail/7008500
阅读全文
摘要:在View中控制日期的显示格式: http://rachelappel.com/create-user-friendly-date-fields-with-asp.net-mvc-editortemplates-amp-jqueryui\DisplayTemplates\DateTime.cshtml@model DateTime @String.Format("{0:d}", Model.Date)\EditorTemplates\DateTime.cshtml@model DateTime@Html.TextBox("", String.Format
阅读全文
摘要:User 为 null不知道是不是Bug?
阅读全文
摘要:Open the Movie.cs file. The System.ComponentModel.DataAnnotations namespace provides formatting attributes in addition to the built-in set of validation attributes. You'll apply the DisplayFormat attribute and a DataType enumeration value to the release date and to the price fields. The followin
阅读全文
摘要:@using (Html.BeginForm()){ <p>销售状态: @Html.DropDownList("Status", "All") <input type="submit" value="Filter" /></p> } public ActionResult Index(string status) { ViewBag.Status = PowerCar.DB.Enums.MerchandiseStatus.StatusList; String
阅读全文
摘要:1. 上传大文件 http://www.cnblogs.com/lucslg/archive/2011/06/26/2090885.html 2. 在asp.net mvc中使用Uploadify上传文件 http://www.cnblogs.com/dingji/archive/2010/07/07/1772909.html3. JQuery 上传插件Uploadify 使用详解 http://www.cnblogs.com/dingji/archive/2010/07/07/1772909.html4. Uploadify的官方网站 http://www.uploadify.com/5.
阅读全文
摘要:1. 直接在页面初始化 @Html.DropDownListFor(model => model.Status, new SelectList(new string[] {"正常", "暂停销售"}))2.从数据库中读取 Text Valuehttp://code-inside.de/blog-in/2010/12/25/howto-apply-mvc2-html-dropdownlistfor/5. 与 enum 的联系 http://www.dotblogs.com.tw/jed/archive/2010/09/12/mvc_dropdownl
阅读全文
摘要:[HttpPost] public ActionResult RemoveFromCart(int id) { // Remove the item from the cart var cart = ShoppingCart.GetCart(this.HttpContext); // Get the name of the album to display confirmation string albumName = storeDB.Carts .Single(item => item.RecordId == id).Album.Title; // Remove from cart i
阅读全文
摘要: Required – Indicates that the property is a required field DisplayName – Defines the text we want used on form fields and validation messages StringLength – Defines a maximum length for a string field Range – Gives a maximum and minimum value for a numeric field Bind – Lists fields to exclude
阅读全文
摘要:public ActionResult Create(){ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name");ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name");return View();}@Html.DropDownList("GenreId", String.Empty)
阅读全文
摘要:public string Browse(string genre){string message = HttpUtility.HtmlEncode("Store.Browse, Genre = " + genre);return message;}
阅读全文
摘要:@model IEnumerable<MvcMusicStore.Models.Album>@helper Truncate(string input, int length){if (input.Length <= length) { @input} else { @input.Substring(0, length)<text>...</text>}}@{ViewBag.Title = "Index"; }<h2>Index</h2><p> @Html.ActionLink("Cre
阅读全文
摘要:public ActionResult Create(){ViewBag.GenreId = new SelectList(db.Genres, "GenreId", "Name");ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name");return View();}@Html.DropDownList("GenreId", String.Empty)
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.ComponentModel;using System.ComponentModel.DataAnnotations;namespace TravelBusiness{ [MetadataType(typeof(HTL_HotelMetadata))] public partial class HTL_Hotel { private class HTL_HotelMetadata { #region 基元属性
阅读全文