ASP.NET
Èý¡¢ÈçºÎ£ºÉèÖà ASP.NET Web ·þÎñÆ÷¿Ø¼þÊôÐÔ
ÔÚ ASP.NET ÍøÒ³ÖУ¬¸ù¾ÝËùÐèµÄÊôÐÔ (Property) ÉèÖÿؼþÉùÃ÷µÄÊôÐÔ (Attribute)¡£
ÄúËùÉèÖõÄÈ·ÇÐÊôÐÔÈ¡¾öÓڿؼþºÍÊôÐÔ¡£ÓйØÌض¨¿Ø¼þµÄÊôÐÔµÄÐÅÏ¢£¬ÇëÔÚ“°ïÖú”Ë÷ÒýÖÐËÑË÷¸Ã¿Ø¼þÀàµÄÃû³Æ£¨ÀýÈ磬“Button Àà (System.Web.UI.WebControls)”£©¡£
ÏÂÃæµÄʾÀýÑÝʾÈçºÎÉèÖà TextBox ¿Ø¼þµÄ MaxLength ÊôÐÔ£º
<asp:textbox id="TextBox1" runat=server maxlength=20 />
°²È«ËµÃ÷£º TextBox ½ÓÊÜÓû§ÊäÈ룬Õ⽫ÊÇÒ»¸öDZÔڵݲȫÍþв¡£Ä¬ÈÏÇé¿öÏ£¬ASP.NET ÍøÒ³ÑéÖ¤Óû§ÊäÈëÊÇ·ñ²»°üÀ¨½Å±¾»ò HTML ÔªËØ¡£
˵Ã÷£º ÔÚ Web ·þÎñÆ÷¿Ø¼þÖУ¬Î´Ó³Éäµ½¸Ã¿Ø¼þÊôÐÔ (Property) µÄÈκÎÊôÐÔ (Attribute) ÒÔÔÑù´«µÝµ½ä¯ÀÀÆ÷¡£
1¡¢ÈçºÎ£º¸ù¾Ý¼òµ¥Öµ»òö¾ÙÉèÖà Web ·þÎñÆ÷¿Ø¼þµÄÊôÐÔ
Èç¹û Web ·þÎñÆ÷¿Ø¼þÊôÐÔµÄÊý¾ÝÀàÐÍΪ»ùÔªÀàÐÍ£¬Èç String¡¢Boolean »ò numeric ÀàÐÍ£¬ÄÇôֻÐ轫ÊôÐÔÖµÖ¸¶¨¸øÊôÐÔ¼´¿ÉÉèÖÃÊôÐÔÖµ¡£Í¬Ñù£¬Èç¹ûÊôÐÔÖµÔÚö¾ÙÀàÖж¨Ò壬Äú¿ÉÒÔÖ»½«¸Ãö¾ÙÖ¸¶¨µ½ÊôÐÔ¡£
A¡¢ÉèÖûùÓÚµ¥ÖµµÄÊôÐÔÖµ
½«Öµ×÷ΪÎÄ×Ö»ò±äÁ¿Ö¸¶¨£¬ÈçÏÂÃæµÄʾÀýËùʾ£º
Label1.Text = "Hello";
DataGrid1.PageSize = 5;
B¡¢ÉèÖûùÓÚö¾ÙµÄÊôÐÔÖµ
ʹÓÃÒ»¸öö¾ÙÖµÖ¸¶¨Öµ¡£ASP.NET ¿ÉÒÔ»ùÓÚÊôÐÔµÄÀàÐͽâÎöö¾Ù¡£ÏÂÃæµÄ´úÂëʾÀý²ûÊÍÈçºÎʹÓÃö¾ÙÉèÖÃÊôÐÔ£º
// Uses TextBoxMode enumeration
TextBox1.TextMode = TextBoxMode.SingleLine;
// Uses ImageAlign enumeration
Image1.ImageAlign = ImageAlign.Middle;
2¡¢ÈçºÎ£ºÉèÖà Web ·þÎñÆ÷¿Ø¼þµÄµ¥Î»ÊôÐÔ
Web ·þÎñÆ÷¿Ø¼þµÄ¿í¶È¡¢¸ß¶ÈºÍÀàËÆÊôÐÔÊÇÒÔµ¥Î»ÉèÖõġ£µ¥Î»ÊÇÒÔ¶ÔÏó£¨Unit ½á¹¹£©µÄÐÎʽʵÏֵģ¬Ê¹ÓÃÕâЩ¶ÔÏó£¬Äú¿ÉÒÔͨ¹ý¶àÖÖ·½Ê½Ö¸¶¨ÖµºÍ¶ÈÁ¿µ¥Î»¡£
·ÉèÖûùÓÚµ¥Î»µÄÊôÐÔ
½«¶Ô Unit ½á¹¹µÄÒýÓ÷ÖÅä¸ø¿Ø¼þ¡£
ÏÂÃæµÄ´úÂëʾÀýÑÝʾÍê³ÉÕâÒ»²Ù×÷µÄ¶àÖÖ;¾¶¡£
// Default is pixels.
TextBox1.Width = new Unit(100);
TextBox1.Width = new Unit(100, UnitType.Pixel);
TextBox1.Width = new Unit("100px");
// Cen
Ïà¹ØÎĵµ£º
ASP.NET ÅäÖÃÎļþ¹¦ÄÜÔÊÐíÄú´æ´¢¼òµ¥£¨±êÁ¿£©Öµ¡¢¼¯ºÏºÍÆäËû¸´ÔÓÀàÐÍ£¬ÒÔ¼°Óû§¶¨ÒåµÄÀàÐÍ¡£
1¡¢ÊôÐÔ¶¨ÒåÐÅÏ¢
ÔÚÅäÖÃÎļþÖж¨ÒåÊôÐÔʱ£¬Ó¦Ö¸¶¨½«ÓÃÓÚÒýÓøÃÊôÐÔµÄÃû³Æ¡£ÀýÈ磬Èç¹ûÒª´æ´¢ÓÊÕþ±àÂ룬Ôò¿ÉÒÔ½«ÊôÐÔÃüÃûΪ PostalCode£¬È»ºó¿ÉÒÔ»ñÈ¡ÊôÐÔÖµ²¢½«ÆäÉèÖÃΪ Profile.Pos ......
Èý²ã¼Ü¹¹(3-tier application) ͨ³£ÒâÒåÉϵÄÈý²ã¼Ü¹¹¾ÍÊǽ«Õû¸öÒµÎñÓ¦Óû®·ÖΪ£º±íÏֲ㣨UI£©¡¢ÒµÎñÂß¼²ã£¨BLL£©¡¢Êý¾Ý·ÃÎʲ㣨DAL£©¡£Çø·Ö²ã´ÎµÄÄ¿µÄ¼´ÎªÁË“¸ßÄÚ¾Û£¬µÍñîºÏ”µÄ˼Ïë¡£
1¡¢±íÏֲ㣨UI£©£ºÍ¨Ë×½²¾ÍÊÇÕ¹ÏÖ¸øÓû§µÄ½çÃ棬¼´Óû§ÔÚʹÓÃÒ»¸öϵͳµÄʱºòËûµÄËù¼ûËùµÃ¡£
2¡¢ÒµÎñ ......
using System;
using System.Collections.Specialized;
using System.Data;
using System.Configuration;
using System.Collections;
using System.IO;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebC ......
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practi ......