The main reborn ASP.NET MVC4.0: using CheckBoxListHelper and RadioBoxListHelper
The new Helpers folder in the project, to create the CheckBoxListHelper and RadioBoxListHelper classes.
CheckBoxListHelper code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Web;
using System.Web.Mvc; namespace SHH.Helpers
{
public static class CheckBoxListHelper
{
public static MvcHtmlString CheckBoxList(this HtmlHelper helper, string name, bool isHorizon = true)
{
return CheckBoxList(helper, name, helper.ViewData[name] as IEnumerable<SelectListItem>, new { }, isHorizon);
} public static MvcHtmlString CheckBoxList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> selectList, bool isHorizon = true)
{
return CheckBoxList(helper, name, selectList, new { }, isHorizon);
} public static MvcHtmlString CheckBoxListFor<TModel, TProperty>(this HtmlHelper helper, Expression<Func<TModel, TProperty>> expression, IEnumerable<SelectListItem> selectList, bool isHorizon = true)
{
string[] propertys = expression.ToString().Split(".".ToCharArray());
string id = string.Join("_", propertys, 1, propertys.Length - 1);
string name = string.Join(".", propertys, 1, propertys.Length - 1); return CheckBoxList(helper, id, name, selectList, new { }, isHorizon);
} public static MvcHtmlString CheckBoxList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> selectList, object htmlAttributes, bool isHorizon = true)
{
return CheckBoxList(helper, name, name, selectList, htmlAttributes, isHorizon);
} public static MvcHtmlString CheckBoxList(this HtmlHelper helper, string id, string name, IEnumerable<SelectListItem> selectList, object htmlAttributes, bool isHorizon = true)
{
IDictionary<string, object> HtmlAttributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); HashSet<string> set = new HashSet<string>();
List<SelectListItem> list = new List<SelectListItem>();
string selectedValues = (selectList as SelectList).SelectedValue == null ? string.Empty : Convert.ToString((selectList as SelectList).SelectedValue);
if (!string.IsNullOrEmpty(selectedValues))
{
if (selectedValues.Contains(","))
{
string[] tempStr = selectedValues.Split(',');
for (int i = 0; i <tempStr.Length; i++)
{
set.Add(tempStr[i].Trim());
} }
else
{
set.Add(selectedValues);
}
} foreach (SelectListItem item in selectList)
{
item.Selected = (item.Value != null) ? set.Contains(item.Value) : set.Contains(item.Text);
list.Add(item);
}
selectList = list; HtmlAttributes.Add("type", "checkbox");
HtmlAttributes.Add("id", id);
HtmlAttributes.Add("name", name);
HtmlAttributes.Add("style", "border:none;"); StringBuilder stringBuilder = new StringBuilder(); foreach (SelectListItem selectItem in selectList)
{
IDictionary<string, object> newHtmlAttributes = HtmlAttributes.DeepCopy();
newHtmlAttributes.Add("value", selectItem.Value);
if (selectItem.Selected)
{
newHtmlAttributes.Add("checked", "checked");
} TagBuilder tagBuilder = new TagBuilder("input");
tagBuilder.MergeAttributes<string, object>(newHtmlAttributes);
string inputAllHtml = tagBuilder.ToString(TagRenderMode.SelfClosing);
string containerFormat = isHorizon ? @"<label> {0} {1}</label>" : @"<p><label> {0} {1}</label></p>";
stringBuilder.AppendFormat(containerFormat,
inputAllHtml, selectItem.Text);
}
return MvcHtmlString.Create(stringBuilder.ToString()); }
private static IDictionary<string, object> DeepCopy(this IDictionary<string, object> ht)
{
Dictionary<string, object> _ht = new Dictionary<string, object>(); foreach (var p in ht)
{
_ht.Add(p.Key, p.Value);
}
return _ht;
}
}
}
RadioBoxListHelper code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc; namespace SHH.Helpers
{
public static class RadioBoxListHelper
{
public static MvcHtmlString RadioBoxList(this HtmlHelper helper, string name)
{
return RadioBoxList(helper, name, helper.ViewData[name] as IEnumerable<SelectListItem>, new { });
} public static MvcHtmlString RadioBoxList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> selectList)
{
return RadioBoxList(helper, name, selectList, new { });
} public static MvcHtmlString RadioBoxList(this HtmlHelper helper, string name, IEnumerable<SelectListItem> selectList, object htmlAttributes)
{
IDictionary<string, object> HtmlAttributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes); HtmlAttributes.Add("type", "radio");
HtmlAttributes.Add("name", name); StringBuilder stringBuilder = new StringBuilder();
int i = 0;
int j = 0;
foreach (SelectListItem selectItem in selectList)
{
string id = string.Format("{0}{1}", name, j++); IDictionary<string, object> newHtmlAttributes = HtmlAttributes.DeepCopy();
newHtmlAttributes.Add("value", selectItem.Value);
newHtmlAttributes.Add("id", id);
var selectedValue = (selectList as SelectList).SelectedValue;
if (selectedValue == null)
{
if (i++ == 0)
newHtmlAttributes.Add("checked", null);
}
else if (selectItem.Value == selectedValue.ToString())
{
newHtmlAttributes.Add("checked", null);
} TagBuilder tagBuilder = new TagBuilder("input");
tagBuilder.MergeAttributes<string, object>(newHtmlAttributes);
string inputAllHtml = tagBuilder.ToString(TagRenderMode.SelfClosing);
stringBuilder.AppendFormat(@" {0} <label for='{2}'>{1}</label>",
inputAllHtml, selectItem.Text, id);
}
return MvcHtmlString.Create(stringBuilder.ToString()); }
private static IDictionary<string, object> DeepCopy(this IDictionary<string, object> ht)
{
Dictionary<string, object> _ht = new Dictionary<string, object>(); foreach (var p in ht)
{
_ht.Add(p.Key, p.Value);
}
return _ht;
}
}
}
Enumeration to help the class code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; namespace SHH.Helpers
{
/// <summary>
/// Enumeration helper classes
/// </summary>
public class EnumHelper
{
/// <summary>
/// Such as: "enum1, enum2 conversion, enum3" string to the enumeration values
/// </summary>
/// <typeparam name="T">Enumeration types</typeparam>
/// <param name="obj">The enumerated string</param>
/// <returns></returns>
public static T Parse<T>(string obj)
{
if (string.IsNullOrEmpty(obj))
return default(T);
else
return (T)Enum.Parse(typeof(T), obj);
} public static T TryParse<T>(string obj, T defT = default(T))
{
try
{
return Parse<T>(obj);
}
catch
{
return defT;
}
} public static readonly string ENUM_TITLE_SEPARATOR = ",";
/// <summary>
/// According to the enumeration value, return a string describing the
/// If multiple enumeration, return to the "," separated string
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public static string GetEnumTitle(Enum e, Enum language = null)
{
if (e == null)
{
return "";
}
string[] valueArray = e.ToString().Split(ENUM_TITLE_SEPARATOR.ToArray(), StringSplitOptions.RemoveEmptyEntries);
Type type = e.GetType();
string ret = "";
foreach (string enumValue in valueArray)
{
System.Reflection.FieldInfo fi = type.GetField(enumValue.Trim());
if (fi == null)
continue;
EnumTitleAttribute[] attrs = fi.GetCustomAttributes(typeof(EnumTitleAttribute), false) as EnumTitleAttribute[];
if (attrs != null && attrs.Length > 0 && attrs[0].IsDisplay)
{
ret += attrs[0].Title + ENUM_TITLE_SEPARATOR;
}
}
return ret.TrimEnd(ENUM_TITLE_SEPARATOR.ToArray());
} /// <summary>
/// According to the enumeration value, return a string describing the
/// If multiple enumeration, return to the "," separated string
/// </summary>
/// <param name="e"></param>
/// <returns></returns>
public static string GetAllEnumTitle(Enum e, Enum language = null)
{
if (e == null)
{
return "";
}
string[] valueArray = e.ToString().Split(ENUM_TITLE_SEPARATOR.ToArray(), StringSplitOptions.RemoveEmptyEntries);
Type type = e.GetType();
string ret = "";
foreach (string enumValue in valueArray)
{
System.Reflection.FieldInfo fi = type.GetField(enumValue.Trim());
if (fi == null)
continue;
EnumTitleAttribute[] attrs = fi.GetCustomAttributes(typeof(EnumTitleAttribute), false) as EnumTitleAttribute[];
if (attrs != null && attrs.Length > 0)
{
ret += attrs[0].Title + ENUM_TITLE_SEPARATOR;
}
}
return ret.TrimEnd(ENUM_TITLE_SEPARATOR.ToArray());
} public static EnumTitleAttribute GetEnumTitleAttribute(Enum e, Enum language = null)
{
if (e == null)
{
return null;
}
string[] valueArray = e.ToString().Split(ENUM_TITLE_SEPARATOR.ToArray(), StringSplitOptions.RemoveEmptyEntries);
Type type = e.GetType();
EnumTitleAttribute ret = null;
foreach (string enumValue in valueArray)
{
System.Reflection.FieldInfo fi = type.GetField(enumValue.Trim());
if (fi == null)
continue;
EnumTitleAttribute[] attrs = fi.GetCustomAttributes(typeof(EnumTitleAttribute), false) as EnumTitleAttribute[];
if (attrs != null && attrs.Length > 0)
{
ret = attrs[0];
break;
}
}
return ret;
} public static string GetDayOfWeekTitle(DayOfWeek day, Enum language = null)
{
switch (day)
{
case DayOfWeek.Monday:
return "Monday";
case DayOfWeek.Tuesday:
return "Tuesday";
case DayOfWeek.Wednesday:
return "Wednesday";
case DayOfWeek.Thursday:
return "Thursday";
case DayOfWeek.Friday:
return "Friday";
case DayOfWeek.Saturday:
return "Saturday";
case DayOfWeek.Sunday:
return "Sunday";
default:
return "";
}
} /// <summary>
/// Returns the key value pairs, built for the name of the specified enumeration of EnumTitle and synonym name, value is the enumeration entries
/// </summary>
/// <typeparam name="T">Enumeration types</typeparam>
/// <param name="language"></param>
/// <returns></returns>
public static Dictionary<string, T> GetTitleAndSynonyms<T>(Enum language = null) where T : struct
{
Dictionary<string, T> ret = new Dictionary<string, T>();
//Enumeration values
Array arrEnumValue = typeof(T).GetEnumValues();
foreach (object enumValue in arrEnumValue)
{
System.Reflection.FieldInfo fi = typeof(T).GetField(enumValue.ToString());
if (fi == null)
{
continue;
} EnumTitleAttribute[] arrEnumTitleAttr = fi.GetCustomAttributes(typeof(EnumTitleAttribute), false) as EnumTitleAttribute[];
if (arrEnumTitleAttr == null || arrEnumTitleAttr.Length <1 || !arrEnumTitleAttr[0].IsDisplay)
{
continue;
} if (!ret.ContainsKey(arrEnumTitleAttr[0].Title))
{
ret.Add(arrEnumTitleAttr[0].Title, (T)enumValue);
} if (arrEnumTitleAttr[0].Synonyms == null || arrEnumTitleAttr[0].Synonyms.Length <1)
{
continue;
} foreach (string s in arrEnumTitleAttr[0].Synonyms)
{
if (!ret.ContainsKey(s))
{
ret.Add(s, (T)enumValue);
}
}
}//using
return ret;
} /// <summary>
/// Based on the enumeration to obtain contains all all values and describe the hash table, the text is composed by the application in the enumeration values on the EnumTitleAttribute set
/// </summary>
/// <returns></returns>
public static Dictionary<T, string> GetItemList<T>(Enum language = null) where T : struct
{
return GetItemValueList<T, T>(false, language);
} /// <summary>
/// Based on the enumeration to obtain contains all all values and describe the hash table, the text is composed by the application in the enumeration values on the EnumTitleAttribute set
/// </summary>
/// <returns></returns>
public static Dictionary<T, string> GetAllItemList<T>(Enum language = null) where T : struct
{
return GetItemValueList<T, T>(true, language);
} /// <summary>
/// Access to enumerate all the title, the text is composed by the application in the enumeration values on the EnumTitleAttribute set
/// </summary>
/// <typeparam name="T">Enumeration types</typeparam>
/// <param name="language">Language</param>
/// <returns></returns>
public static Dictionary<int, string> GetItemValueList<T>(Enum language = null) where T : struct
{
return GetItemValueList<T, int>(false, language);
} /// <summary>
/// Access to enumerate all the title, the text is composed by the application in the enumeration values on the EnumTitleAttribute set
/// </summary>
/// <typeparam name="T">Enumeration types</typeparam>
/// <param name="isAll">Whether to build the "all"</param>
/// <param name="language">Language</param>
/// <returns></returns>
public static Dictionary<TKey, string> GetItemValueList<T, TKey>(bool isAll, Enum language = null) where T : struct
{
if (!typeof(T).IsEnum)
{
throw new Exception("The parameter must be enumerated!");
}
Dictionary<TKey, string> ret = new Dictionary<TKey, string>(); var titles = EnumHelper.GetItemAttributeList<T>().OrderBy(t => t.Value.Order);
foreach (var t in titles)
{
if (!isAll && (!t.Value.IsDisplay || t.Key.ToString() == "None"))
continue; if (t.Key.ToString() == "None" && isAll)
{
ret.Add((TKey)(object)t.Key, "All");
}
else
{
if (!string.IsNullOrEmpty(t.Value.Title))
ret.Add((TKey)(object)t.Key, t.Value.Title);
}
} return ret;
} public static List<T> GetItemKeyList<T>(Enum language = null) where T : struct
{
List<T> list = new List<T>();
Array array = typeof(T).GetEnumValues();
foreach (object t in array)
{
list.Add((T)t);
}
return list;
} public static Dictionary<T, EnumTitleAttribute> GetItemAttributeList<T>(Enum language = null) where T : struct
{
if (!typeof(T).IsEnum)
{
throw new Exception("The parameter must be enumerated!");
}
Dictionary<T, EnumTitleAttribute> ret = new Dictionary<T, EnumTitleAttribute>(); Array array = typeof(T).GetEnumValues();
foreach (object t in array)
{
EnumTitleAttribute att = GetEnumTitleAttribute(t as Enum, language);
if (att != null)
ret.Add((T)t, att);
} return ret;
} /// <summary>
/// Access to enumerate all the title, the text is composed by the application in the enumeration values on the EnumTitleAttribute set
/// </summary>
/// <typeparam name="T">Enumeration types</typeparam>
/// <param name="isAll">Whether to build the "all"</param>
/// <param name="language">Language</param>
/// <returns></returns>
public static Dictionary<TKey, string> GetAllItemValueList<T, TKey>(Enum language = null) where T : struct
{
return GetItemValueList<T, TKey>(true, language);
} /// <summary>
/// Gets an enumeration pairs
/// </summary>
/// <typeparam name="TEnum">Enumeration types</typeparam>
/// <param name="exceptTypes">Exclude the enumeration</param>
/// <returns></returns>
public static Dictionary<int, string> GetEnumDictionary<TEnum>(IEnumerable<TEnum> exceptTypes = null) where TEnum : struct
{
var dic = GetItemList<TEnum>(); Dictionary<int, string> dicNew = new Dictionary<int, string>();
foreach (var d in dic)
{
if (exceptTypes != null && exceptTypes.Contains(d.Key))
{
continue;
}
dicNew.Add(d.Key.GetHashCode(), d.Value);
}
return dicNew;
} } public class EnumTitleAttribute : Attribute
{
private bool _IsDisplay = true; public EnumTitleAttribute(string title, params string[] synonyms)
{
Title = title;
Synonyms = synonyms;
Order = int.MaxValue;
}
public bool IsDisplay { get { return _IsDisplay; } set { _IsDisplay = value; } }
public string Title { get; set; }
public string Description { get; set; }
public string Letter { get; set; }
/// <summary>
/// Synonyms
/// </summary>
public string[] Synonyms { get; set; }
public int Category { get; set; }
public int Order { get; set; }
}
}
Enumeration data code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web; namespace SHH.Helpers
{
public class EnumData
{
/// <summary>
/// Gender
/// </summary>
public enum EnumSex
{
[EnumTitle("Hello, sir")]
Sir = 1, [EnumTitle("Ma'am")]
Miss = 2
}
/// <summary>
/// Make an appointment
/// </summary>
public enum EnumBespeakDate
{
[EnumTitle("Working days (Monday to Friday)")]
BespeakDate1 = 1, [EnumTitle("The weekend")]
BespeakDate2 = 2, [EnumTitle("Weekdays or weekends")]
BespeakDate3 = 3
}
/// <summary>
/// Appointments
/// </summary>
public enum EnumBespeakTime
{
[EnumTitle("Morning")]
BespeakTime1 = 1, [EnumTitle("The afternoon")]
BespeakTime2 = 2, [EnumTitle("Night")]
BespeakDate3 = 3, [EnumTitle("At any time")]
BespeakDate4= 4
} /// <summary>
/// The price
/// </summary>
public enum EnumPriceGroup
{
[EnumTitle("Unlimited", IsDisplay = false)]
None = 0, [EnumTitle("300000 the following")]
Below30 = 1, [EnumTitle("30-50 million")]
From30To50 = 2, [EnumTitle("50-80 million")]
From50To80 = 3, [EnumTitle("80-100 million")]
From80To100 = 4, [EnumTitle("100-150 million")]
From100To50 = 5, [EnumTitle("150-200 million")]
From150To200 = 6, [EnumTitle("More than 2000000")]
Above200 = 7
} /// <summary>
/// The measure of area
/// </summary>
public enum EnumAcreageGroup
{ [EnumTitle("Unlimited", IsDisplay = false)]
None = 0, [EnumTitle("The following 50mm")]
Below50 = 1, [EnumTitle("50-70mm")]
From50To70 = 2, [EnumTitle("70-90mm")]
From70To90 = 3, [EnumTitle("90-120mm")]
From90To120 = 4, [EnumTitle("120-150mm")]
From120To150 = 5, [EnumTitle("150-200mm")]
From150To200 = 6, [EnumTitle("200-300mm")]
From200To300 = 7, [EnumTitle("More than 300mm")]
Above300 = 8
} /// <summary>
/// Fangxing two chamber room five room five room above
/// </summary>
public enum EnumRoomGroup
{
[EnumTitle("Unlimited", IsDisplay = false)]
None = 0, [EnumTitle("A room")]
Room1 = 1, [EnumTitle("Room two")]
Room2 = 2, [EnumTitle("3")]
Room3 = 3, [EnumTitle("Four")]
Room4 = 4, [EnumTitle("Room five")]
Room5 = 5, [EnumTitle("More than five rooms")]
Above5 = 6
}
}
}
Controller code[RadioBox]
ViewData.Add("EnumPriceGroup", new SelectList(EnumHelper.GetItemValueList<EnumData.EnumPriceGroup>(), "Key", "Value"));
ViewData.Add("EnumAcreageGroup", new SelectList(EnumHelper.GetItemValueList<EnumData.EnumAcreageGroup>(), "Key", "Value"));
ViewData.Add("EnumRoomGroup", new SelectList(EnumHelper.GetItemValueList<EnumData.EnumRoomGroup>(), "Key", "Value"));
View code[RadioBox]
@Html.RadioBoxList("EnumPriceGroup")
@Html.RadioBoxList("EnumAcreageGroup")
@Html.RadioBoxList("EnumRoomGroup")
Controller code[CheckBox]
TagRepository tagrep = new TagRepository();
var tag = tagrep.GetModelList().Where(d=>d.TypeID==1);
ViewBag.Tags = new SelectList(tag, "TagID", "TagName");
var tag1 = tagrep.GetModelList().Where(d => d.TypeID == 2);
ViewBag.Tags1 = new SelectList(tag1, "TagID", "TagName");
var tag2 = tagrep.GetModelList().Where(d => d.TypeID == 3);
ViewBag.Tags2 = new SelectList(tag2, "TagID", "TagName");
/// <summary>
/// Add GET: /admin/House/Add
/// </summary>
/// <param name="model">The entity class</param>
/// <param name="fc"></param>
/// <returns></returns>
[Authorize, HttpPost, ValidateInput(false)]
public ActionResult Add(House model, FormCollection fc,int[] Tags, int[] Tags1,int[] Tags2)
{ model.State = 1;
model.CreateTime = DateTime.Now;
HouseControllerrep.SaveOrEditModel(model); if (Tags.Length > 0)
{ foreach (int gsi in Tags){
TagHouseMapping thmtag = new TagHouseMapping();
thmtag.TagID=gsi;
thmtag.HouseID = model.HouseID;
thmtag.State = 1;
thmtag.CreateTime = DateTime.Now;
TagCrep.SaveOrEditModel(thmtag);
}
}
if (Tags1.Length > 0)
{ foreach (int gsi in Tags1)
{
TagHouseMapping thmtag = new TagHouseMapping();
thmtag.TagID = gsi;
thmtag.HouseID = model.HouseID;
thmtag.State = 1;
thmtag.CreateTime = DateTime.Now;
TagCrep.SaveOrEditModel(thmtag);
}
}
if (Tags2.Length > 0)
{ foreach (int gsi in Tags2)
{
TagHouseMapping thmtag = new TagHouseMapping();
thmtag.TagID = gsi;
thmtag.HouseID = model.HouseID;
thmtag.State = 1;
thmtag.CreateTime = DateTime.Now;
TagCrep.SaveOrEditModel(thmtag);
}
}
return RedirectToAction("Index");
}
#endregion
View code[CheckBox]
@Html.CheckBoxList("Tags")
@Html.CheckBoxList("Tags1")
@Html.CheckBoxList("Tags2")
The effect of CheckBoxList

The effect of RadioBoxList

转自:http://www.programering.com/a/MDN2AzNwATQ.html
The main reborn ASP.NET MVC4.0: using CheckBoxListHelper and RadioBoxListHelper的更多相关文章
- 建筑材料系统 ASP.NET MVC4.0 + WebAPI + EasyUI + Knockout 的架构设计开发
框架介绍: 1.基于 ASP.NET MVC4.0 + WebAPI + EasyUI + Knockout 的架构设计开发 2.采用MVC的框架模式,具有耦合性低.重用性高.生命周期成本低.可维护性 ...
- 利用CSS预处理技术实现项目换肤功能(less css + asp.net mvc4.0 bundle)
一.背景 在越来越重视用户体验的今天,换肤功能也慢慢被重视起来.一个web系统用户可以选择一个自己喜欢的系统主题,在用户眼里还是会多少加点分的.我们很开心的是easyui v1.3.4有自带defau ...
- Asp.Net MVC4.0 官方教程 入门指南之五--控制器访问模型数据
Asp.Net MVC4.0 官方教程 入门指南之五--控制器访问模型数据 在这一节中,你将新创建一个新的 MoviesController类,并编写代码,实现获取影片数据和使用视图模板在浏览器中展现 ...
- Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型
Asp.Net MVC4.0 官方教程 入门指南之四--添加一个模型 在这一节中,你将添加用于管理数据库中电影的类.这些类是ASP.NET MVC应用程序的模型部分. 你将使用.NET Framewo ...
- Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图
Asp.Net MVC4.0 官方教程 入门指南之三--添加一个视图 在本节中,您需要修改HelloWorldController类,从而使用视图模板文件,干净优雅的封装生成返回到客户端浏览器HTML ...
- Asp.Net MVC4.0 官方教程 入门指南之二--添加一个控制器
Asp.Net MVC4.0 官方教程 入门指南之二--添加一个控制器 MVC概念 MVC的含义是 “模型-视图-控制器”.MVC是一个架构良好并且易于测试和易于维护的开发模式.基于MVC模式的应用程 ...
- 主攻ASP.NET MVC4.0之重生:ASP.NET MVC使用JSONP
原文:主攻ASP.NET MVC4.0之重生:ASP.NET MVC使用JSONP 原文地址 http://www.codeguru.com/csharp/.net/net_asp/using-jso ...
- Asp.net MVC4.0(net4.5) 部署到window server 2003上的解决方案
Asp.net MVC4.0(net4.5) 部署到window server 2003上的解决方案 最近做了一个Web项目,也没多想就用了Asp.net MVC4.0 ,MVC4.0默认的目标fra ...
- ASP.NET MVC4.0+ WebAPI+EasyUI+KnockOutJS快速开发框架 通用权限管理系统
1.基于 ASP.NET MVC4.0 + WebAPI + EasyUI + Knockout 的架构设计开发 2.采用MVC的框架模式,具有耦合性低.重用性高.生命周期成本低.可维护性高.有利软件 ...
随机推荐
- linux笔记_day09
1.运算器.控制器.存储器.输入输出(IO) 地址总线:内存寻址 数据总线:传输数据 控制总线:控制指令 寄存器:cpu暂时存储器 2.系统设定 默认输出设备:标准输出,STDOUT,1(描述符)(显 ...
- Quartus II 破解教程—FPGA入门教程【钛白Logic】
这一节主要说明如何破解Quartus II 13.1.首先找到我们提供的破解工具,这里我们的电脑是64位的,所以使用64位破解器.如下图. 第一步:将破解工具拷贝到安装目录下“D:\altera\13 ...
- Linux环境下段错误的产生原因及调试方法小结【转】
转自:http://www.cnblogs.com/panfeng412/archive/2011/11/06/2237857.html 最近在Linux环境下做C语言项目,由于是在一个原有项目基础之 ...
- MTD应用学习札记【转】
转自:https://blog.csdn.net/lh2016rocky/article/details/70885421 今天做升级方案用到了mtd-utils中的flash_eraseall和fl ...
- Laravel 的计划任务
避免并发执行 $schedule->command('emails:send')->withoutOverlapping(); 这里需要注意,对于 call function 定义的计划任 ...
- Kmeans 聚类 及其python实现
主要参考 K-means 聚类算法及 python 代码实现 还有 <机器学习实战> 这本书,当然前面那个链接的也是参考这本书,懂原理,会用就行了. 1.概述 K-means ...
- 自定义yum源
1.创建rpm包的存放目录 mkdir -p /yum/yum-sum/package 2.准备rpm包,可以通过自带yum只下载不安装工具下载 yum install --downloadon ...
- UI 框架
Vue.js 之 iView UI 框架 像我们平日里做惯了 Java 或者 .NET 这种后端程序员,对于前端的认识还常常停留在 jQuery 时代,包括其插件在需要时就引用一下,不需要就删除.故观 ...
- 【AtCoder】ARC101题解
C - Candles 题解 点燃的一定是连续的一段,枚举左端点即可 代码 #include <bits/stdc++.h> #define enter putchar('\n') #de ...
- js 高阶函数(map/reduce/filter/sort)
1.map - 方法返回一个新数组,数组中的元素为原始数组元素调用函数处理后的值(注:map不会对空数组进行检测,不会改变原始数组) 语法:array.map(function(currentValu ...