<script type="text/javascript"> $(document).ready(function () { $(".numberinput").forceNumeric(); }); // forceNumeric() plug-in implementation jQuery.fn.forceNumeric = function () { return this.each(function () { $(this).keydown(function (e) { var key = e.which || e.keyCode; if (!e.shiftKey && !e.altKey && !e.ctrlKey && // numbers key >= 48 && key <= 57 || // Numeric keypad key >= 96 && key <= 105 || // comma, period and minus, . on keypad key == 190 || key == 188 || key == 109 || key == 110 || // Backspace and Tab and Enter key == 8 || key == 9 || key == 13 || // Home and End key == 35 || key == 36 || // left and right arrows key == 37 || key == 39 || // Del and Ins key == 46 || key == 45) return true; return false; }); }); } </script>
With the plug-in in place in your page or an external .js file you can now simply use a selector to apply it:
$(".numberinput").forceNumeric();
http://blog.joycode.com/scottgu/
http://www.infoq.com/cn/news/2009/02/ASP.NET-MVC-T4
http://www.cnblogs.com/Leo_wl/archive/2010/11/04/1868830.html
http://www.cnblogs.com/damonlan/archive/2011/11/25/2263122.html
http://developer.51cto.com/art/200907/138550.htm
A query body must end with a select clause or a group clause
DbExpressionBinding requires an input expression with a collection ResultType.Parameter name
when casting from a number the value must be a number less than infinity
<!--StartFragment-->gridComplete: function(){
var ids = jQuery("#rowed2").jqGrid('getDataIDs');
for(var i=0;i < ids.length;i++){
var cl = ids[i];
be = "<input style='height:22px;width:20px;' type='button' value='E' οnclick=\"jQuery('#rowed2').editRow('"+cl+"');\" />";
se = "<input style='height:22px;width:20px;' type='button' value='S' οnclick=\"jQuery('#rowed2').saveRow('"+cl+"');\" />";
ce = "<input style='height:22px;width:20px;' type='button' value='C' οnclick=\"jQuery('#rowed2').restoreRow('"+cl+"');\" />";
jQuery("#rowed2").jqGrid('setRowData',ids[i],{act:be+se+ce});
}
},
http://www.cnblogs.com/n-pei/archive/2010/11/18/1880916.html
public JsonResult UserNameExists(string username) { var user = _repository.GetUserByName(username.Trim()); return user == null ? Json(true, JsonRequestBehavior.AllowGet) : Json(string.Format("{0} is not available.", username), JsonRequestBehavior.AllowGet); }
The type arguments for method 'System.Linq.Enumerable.Select<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,TResult>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
http://silverlight.codeplex.com/releases
http://www.cnblogs.com/lukun/archive/2011/08/22/2144220.html
http://www.cnblogs.com/lukun/archive/2011/04/25/2026801.html
@Html.TextBoxFor(model => model.faddress, new { style = "width:300px;"})
@Html.TextBoxFor(model => model.faddress, new { @class="address_input"})
jQuery(function($){
$("#date").mask("99/99/9999");
$("#phone").mask("(999) 999-9999");
$("#tin").mask("99-9999999");
$("#ssn").mask("999-99-9999");
});
@"^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"
^(?:(?!0000)[0-9]{4}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))$
http://blog.youkuaiyun.com/lxcnn/article/details/4362500
http://robertcorvus.com/automatically-validate-and-format-data-with-asp-net-mvc-and-jquery/
http://www.cnblogs.com/collinye/archive/2010/03/07/1680181.html
builder.RegisterType<MemoryCacheManager>().As<ICacheManager>().Named<ICacheManager>("MemoryCache").SingleInstance();
builder.RegisterType<PerRequestCacheManager>().As<ICacheManager>().Named<ICacheManager>("PerRequest").InstancePerHttpRequest();
private ICacheManager cacheManager
{
get { return DependencyResolver.Current.GetService<ICacheManager>(); }
}
builder.RegisterType<CacheController>().WithParameter(ResolvedParameter.ForNamed<ICacheManager>("MemoryCache"));
http://www.cnblogs.com/wolegequ/archive/2012/06/03/2532605.html
var r = container.ResolveNamed<IDeviceState>(
"online"
);
|