ÔÎĵØÖ·:http://blog.csdn.net/ChengKing/archive/2009/01/01/3678774.aspx
ÊôÐÔµÄÉè¼ÆʱÌØÐÔ
.NET Framework
Ϊ
¿Ø¼þÉè¼ÆʱÊôÐÔÌṩÁ˺ܶà·á¸»µÄÀ࣬ÕâЩÊôÐԵŦÄܷdz£Áé»î£¬¿ØÖÆ·¶Î§¹ã·º£¬±ÈÈç¿ÉÒÔ¿ØÖƸÃÊôÐÔÔÚÊôÐÔ´°¿ÚÖеÄÏÔʾģʽ£¬È磺ÊÇ·ñÔÚÊôÐÔ´°¿ÚÖÐÏÔʾ¸ÃÊô
ÐÔ£¬Ò²¿ÉÒÔÖ¸¶¨´ËÊôÐÔ±ØÐë½ÓÊÕÖµÀàÐÍÃèÊö£¬°´×é·ÖÀàµÈ£¬Ò²¿ÉÒÔ¿ØÖÆÎı¾µÄ±ê¼Ç³ÊÏÖ¸ñʽµÈ£¬ÉõÖÁ¿ÉÒÔ×Ô¼º¶¨ÒåÒ»¸öÊôÐÔÀ࣬ʵÏÖ×Ô¼ºÏëʵÏֵŦÄÜ¡£ÏÂÃæ½²Ò»ÏÂ
³£ÓõÄ
.NET Framework
µÄÊôÐÔÀà¶Ô¿Ø¼þµÄÖ§³Ö¹¦ÄÜ¡£
Ø
Bindable
Ö¸¶¨ÊôÐÔÊÇ·ñ¿ÉÒÔ°ó¶¨Ò»¸öÓÐЧÊý¾ÝÔ´£¬Í¨³£Ê¹Óò¼¶ûÖµ½øÐÐÉèÖá£ÀýÈ磺
Bindable(true)
¡£Èç¹ûʹÓÃÖµ
true
±ê¼ÇÊôÐÔ£¬±íʾ¸ÃÊôÐÔ¿ÉÒÔ°ó¶¨Ò»¸öÓÐЧÊý¾ÝÔ´
¡£
Ø
Browsable
Ö¸¶¨ÊôÐÔÊÇ·ñÓ¦¸ÃÔÚÊôÐÔ´°¿ÚÖÐÏÔʾ£¬Ê¹Óò¼¶ûÖµÉèÖá£Ò»°ãÇé¿öÏÂ
£¬¶ÔÓÚ
³£ÓõĺͱȽÏÖØÒªµÄÊôÐÔÉèÖÃ
Browsable
Ϊ
true
£¬·ñÔò
£¬
ÉèÖÃ
Browsable
Ϊ
false
¡£
Ø
EditorBrowsable
ÉèÖÃÊôÐÔÔÚ±à¼Æ÷ÖеĿɼûÐÔ£¬±ÈÈçÉèÖÃÔÚÖÇÄÜÌáʾÁÐ±í²»ÏÔʾ»ò¸ß¼¶Óû§²Å¿ÉÒÔ¿´µ½¸ÃÊôÐÔ¡£
Ø
Category
Ö¸¶¨ÊôÐÔÔÚÊôÐÔä¯ÀÀÆ÷ÖÐ ......
public ActionResult LoadRegionPerformance(TGProject.Models.WModels.TgsOutachiveCondition condition)
{
Account account = (Account)Session["Account"];
var questions = SP.TgsAreaShow(int.Parse(account.AREAID.ToString()));
List<TGProject.Models.WModels.TGSOUTACHIVEAREA> models=new List<TGProject.Models.WModels.TGSOUTACHIVEAREA>();
TGSAREASHOW a;
IEnumerator ie = (System.Collections.IEnumerator)questions.GetEnumerator();
while (ie.MoveNext()) {
a = (TGSAREASHOW)ie.Current;
condition.AREAID = a.AREAID;
List<TGProject.Models.WModels.TGSOUTACHIVEAREA> middlemodels = TGProject.Helpers.SP.TGSOutAchiveArea(condition);
foreach (TGProject.Models.WModels.TGSOUTACHIVEAREA middlemodel in middlemodels)
models.Add(middlemodel);
}
return GetRegionPerformanceModelData(c ......
ÔÚASP.NETÍøÕ¾ÖÐÍøÕ¾¹ÜÀíºǫ́ÐèÒª¾³£ÑéÖ¤Óû§Éí·Ý,ҪʵÏÖÕâÖÖ¹¦ÄܾͿÉÒÔÀûÓÃÄǸö¼Ì³Ð»úÖƺÍASP.NETµÄʼþ»úÖÆ.Ê×Ïȶ¨ÒåÒ»¸öÐèÒª½øÐÐÉí·ÝÑéÖ¤µÄBasePageÀà,¼Ì³Ð×ÔPageÀà,ÔÚBasePageÀàµÄ¹¹Ô캯ÊýÖж¨ÒåËüµÄ¼ÓÔØʼþµÄ´¦Àí´úÂë,ÕâÑùËùÓм̳Ð×ÔBasePageÀàµÄÒ³Ã涼ÄÜ×Ô¶¯Ö´ÐÐÉí·ÝÑéÖ¤.
/// <summary>
/// ÑéÖ¤µÇ½Àà
/// </summary>
public class ValidateLogin : System.Web.UI.Page //¼Ì³Ð×ÔSystem.Web.UI.Page
{
public ValidateLogin()
{
//µ±Ò³Ãæ¼ÓÔØʱִÐиÃʼþ
this.Load += new EventHandler(BasePage_Load);
}
//¶ÔµÇ¼½øÐÐÑéÖ¤
protected void BasePage_Load(object sender,EventArgs e)
{
if (Session["uid"] == "" || Session["uid"] == null)
{
Response.Redirect("~/login.aspx");
}
}
}
public partial class Default : ValidateLogin //¼Ì³Ð×ÔValidateLoginÀà
{
protected void Page_Load(object sender, EventArgs e)
{
//¼Ì³Ð×ÔVali ......
Èç¹û¶Ô΢ÐͼÆËã»úÓ²¼þϵͳÓÐ×ã¹»µÄÁ˽⣬ÄÇôÎÒÃǶÔÓÚCacheÕâ¸öÃû´ÊÒ»¶¨ÊǶúÊìÄÜÏêµÄ¡£ÔÚCPUÒÔ¼°Ö÷°åµÄоƬÖУ¬¶¼ÒýÈëÁËÕâÖÖÃûΪ¸ßËÙ»º³å´æ´¢Æ÷£¨Cache£©µÄ¼¼Êõ¡£ÒòΪCacheµÄ´æÈ¡ËٶȱÈÄÚ´æ¿ì£¬Òò¶øÒýÈëCacheÄܹ»ÓÐЧµÄ½â¾öCPUÓëÄÚ´æÖ®¼äµÄËٶȲ»Æ¥ÅäÎÊÌâ¡£Ó²¼þϵͳ¿ÉÒÔÀûÓÃCache´æ´¢CPU·ÃÎʸÅÂʸߵÄÄÇЩÊý¾Ý£¬µ±CPUÐèÒª·ÃÎÊÕâЩÊý¾Ýʱ£¬¿ÉÒÔÖ±½Ó´ÓCacheÖжÁÈ¡£¬¶ø²»±Ø·ÃÎÊ´æÈ¡ËÙ¶ÈÏà¶Ô½ÏÂýµÄÄڴ棬´Ó¶øÌá¸ßÁËCPUµÄ¹¤×÷ЧÂÊ¡£Èí¼þÉè¼Æ½è¼øÁËÓ²¼þÉè¼ÆÖÐÒýÈ뻺´æµÄ»úÖÆÒÔ¸ÄÉÆÕû¸öϵͳµÄÐÔÄÜ£¬ÓÈÆäÊǶÔÓÚÒ»¸öÊý¾Ý¿âÇý¶¯µÄWebÓ¦ÓóÌÐò¶øÑÔ£¬»º´æµÄÀûÓÃÊDz»¿É»òȱµÄ£¬±Ï¾¹£¬Êý¾Ý¿â²éѯ¿ÉÄÜÊÇÕû¸öWebÕ¾µãÖе÷ÓÃ×îƵ·±µ«Í¬Ê±ÓÖÊÇÖ´ÐÐ×ÂýµÄ²Ù×÷Ö®Ò»£¬ÎÒÃDz»Äܱ»ËüÀÏÂõµÄË«ÍÈÍÏ»ºÎÒÃÇÇ°½øµÄÕ÷³Ì¡£»º´æ»úÖÆÕýÊǽâ¾öÕâһȱÏݵļÓËÙÆ÷¡£
4.1 ASP.NET»º´æ¸ÅÊö
×÷Ϊ.Net¿ò¼ÜÏ¿ª·¢WebÓ¦ÓóÌÐòµÄÖ÷´ò²úÆ·£¬ASP.NET³ä·Ö¿¼ÂÇÁË»º´æ»úÖÆ¡£Í¨¹ýijÖÖ·½·¨£¬½«ÏµÍ³ÐèÒªµÄÊý¾Ý¶ÔÏó¡¢WebÒ³Ãæ´æ´¢ÔÚÄÚ´æÖУ¬Ê¹µÃWebÕ¾µãÔÚÐèÒª»ñÈ¡ÕâЩÊý¾Ýʱ£¬²»ÐèÒª¾¹ý·±ËöµÄÊý¾Ý¿âÁ¬½Ó¡¢²éѯºÍ¸´ÔÓµÄÂß¼ÔËË㣬¾Í¿ÉÒÔ“´¥Êֿɼ°”£¬Èç“̽ÄÒÈ¡Îï”°ãÈÝÒ׶ø¿ìËÙ£¬´Ó¶øÌá¸ßÕû¸öWebϵͳµ ......
Ò»¡¢ÑéÖ¤Àà
1¡¢Êý×ÖÑéÖ¤ÄÚ
1.1 ÕûÊý
/^(-|\+)?\d+$/.test(str)
1.2 ´óÓÚ0µÄÕûÊý £¨ÓÃÓÚ´«À´µÄIDµÄÑéÖ¤)
/^\d+$/.test(str)
1.3 ¸ºÕûÊýµÄÑéÖ¤
/^-\d+$/.test(str)
2¡¢Ê±¼äÀà
2.1 ¶Ìʱ¼ä£¬ÐÎÈç (13:04:06)
function isTime(str)
{
var a = str.match(/^(\d{1,2})(:)?(\d{1,2})\2(\d{1,2})$/);
if (a == null) {alert('ÊäÈëµÄ²ÎÊý²»ÊÇʱ¼ä¸ñʽ'); return false;}
if (a[1]>24 || a[3]>60 || a[4] ......
ÔÚѧϰ±»Í£ÖÍÁËN¾ÃÒԺ󣬽ñÌìÖÕÓÚ϶¨¾öÐÄÒª¼ÌÐøÁË¡£¹ýÁËÌ«¾Ã¶éÂäµÄÉú»îÒ²¿ªÊ¼Ñá¾ëÁË¡£¼ÌÐø¿ªÊ¼ÎÒµÄMVCѧϰ֮·¡£ Ŀ¼»ú¹¹£º models Îļþ¼Ð£º Ä£ÐÍ×é¼þ »¹¿ÉÒÔ´æ·ÅÓйØÊý¾Ý·ÃÎʲÙ×÷µÄһЩÀà¡¢¶ÔÏóµÄ²Ù×÷µÄ¶¨ÒåµÈ¡£ Views Îļþ¼Ð£º ÊÓͼ×é¼þ¡£¿ÉÒÔ´æ·ÅµÄÎļþÀàÐÍ°üÀ¨.aspxÒ³Ã棬.ascx¿Ø¼þÒÔ¼°.masterĸ°æÒ³µÈ¡£ SharedÎļþ¼Ð£ºÊÓͼ×é¼þÖеĹ«Óò¿·Ö¡£¿ÉÒÔ´æ·Å ĸ°æÒ³¡¢CSSÑùʽµÈÎļþ¡£ ControllersÎļþ¼Ð£º¿ØÖÆÆ÷×é¼þ¡£ ÔÚWeb.ConfigÖÐ×¢²áÁË UrlRoutingModuleÀ࣬ÓÃÓÚ½âÎöURL·ÓÉ¡£
ÔÚGlobal.asaxÎļþÖеÄApplication_Start()·½·¨ÖÐÉèÖÃÁËURL·ÓÉ£¬ÒÔ¼°Ïà¹ØµÄ·ÓÉÂß¼¡£
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // ......