ASP.NET
¾Å¡¢ÒÔ±à³Ì·½Ê½Ìí¼Ó ASP.NET ¿Ø¼þ
ÓÐʱ£¬ÔÚÔËÐÐʱ´´½¨¿Ø¼þ±ÈÔÚÉè¼Æʱ´´½¨¿Ø¼þ¸ü¿ÉÐС£ÀýÈ磬¼Ù¶¨ÓÐÒ»¸öËÑË÷½á¹ûÒ³£¬ÄúÒªÔÚÆäÖн«ÒÔ±íµÄÐÎʽÏÔʾ½á¹û¡£ÓÉÓÚ²»ÖªµÀÒª·µ»Ø¶àÉÙÏÒò´ËÄúÐèҪÿ¸ö·µ»ØµÄÏ̬Éú³ÉÒ»¸ö±íÐС£
˵Ã÷£º ÏÖÓпؼþͨ³£¿ÉÒÔÌṩ´Ó¶¯Ì¬´´½¨¿Ø¼þÖлñµÃµÄ¹¦ÄÜ¡£ÀýÈ磬Repeater¡¢DataList ºÍ RadioButtonList ¿Ø¼þ¿ÉÒÔÔÚÒ³ÔËÐÐʱ¶¯Ì¬´´½¨ÐлòÆäËû¿Ø¼þÔªËØ¡£
Ҫͨ¹ý±à³ÌÏòÒ³Ìí¼Ó¿Ø¼þ£¬Ôò±ØÐëÓзÅÖÃпؼþµÄÈÝÆ÷¡£ÀýÈ磬Èç¹ûÄú´òËã´´½¨±íÐУ¬ÄÇôÈÝÆ÷¾ÍÊÇ±í¡£Èç¹ûûÓÐÃ÷ÏԵĿؼþÓÃ×÷ÈÝÆ÷£¬¿ÉÒÔʹÓà PlaceHolder »ò Panel Web ·þÎñÆ÷¿Ø¼þ¡£
ÔÚijЩÇé¿öÏ£¬¿ÉÄÜÐèÒª¼È´´½¨¾²Ì¬Îı¾ÓÖ´´½¨¿Ø¼þ¡£Òª´´½¨¾²Ì¬Îı¾£¬¿ÉÒÔʹÓà Literal »ò Label Web ·þÎñÆ÷¿Ø¼þ¡£È»ºó¿ÉÒÔ½«ÕâЩ¿Ø¼þÏñÆäËû¿Ø¼þÒ»ÑùÌí¼Óµ½ÈÝÆ÷ÖС£
ͨ¹ý±à³Ì·½Ê½½«¿Ø¼þÌí¼Óµ½ Web ÍøÒ³
1¡¢´´½¨¿Ø¼þµÄʵÀý²¢ÉèÖÃÆäÊôÐÔ£¬ÈçÏÂÃæµÄʾÀýËùʾ£º
Label myLabel = new Label();
myLabel.Text = "Sample Label";
˵Ã÷£º ¿Ø¼þͨ³£ÔÚÒ³µÄ³õʼ»¯½×¶ÎÌí¼Óµ½Ò³ÖÐ
2¡¢½«Ð¿ؼþÌí¼Óµ½Ò³ÉÏÒÑÓÐÈÝÆ÷µÄ Controls ¼¯ºÏÖУ¬ÈçÏÂÃæµÄʾÀýËùʾ£º
Panel Panel1= new Panel();
Panel1.Controls.Add(myLabel);
˵Ã÷£º ÒòΪ Controls ÊôÐÔÊÇÒ»¸ö¼¯ºÏ£¬Äú¿ÉÒÔʹÓà AddAt ·½·¨ÔÚÌض¨Î»Ö÷ÅÖÃпؼþ£¬ÀýÈçÔÚÆäËû¿Ø¼þµÄÇ°Ãæ¡£µ«ÊÇÕ⽫»áÔÚÒ³ÖÐÒýÈë´íÎó¡£
ÏÂÃæµÄ´úÂëʾÀýÑÝʾÃûΪ DropDownList1 µÄ¿Ø¼þµÄ SelectedIndexChanged ʼþµÄʼþ´¦Àí³ÌÐò¡£¸Ã´¦Àí³ÌÐò´´½¨µÄ±êÇ© (Label) ¿Ø¼þµÄÊýÁ¿ºÍÓû§´ÓÏÂÀÁбíÖÐËùÑ¡µÄÊýÁ¿Ïàͬ¡£ÕâЩ¿Ø¼þµÄÈÝÆ÷ÊÇÃûΪ Placeholder1 µÄ PlaceHolder Web ·þÎñÆ÷¿Ø¼þ¡£
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
DropDownList DropDownList1 = new DropDownList();
PlaceHolder PlaceHolder1 = new PlaceHolder();
// Get the number of labels to create.
int numlabels = System.Convert.ToInt32(DropDownList1.SelectedItem.Text);
for (int i=1; i<=numlabels; i++)
{
Label myLabel = new Label();
// Set the label's Te
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
Ò»¡¢Î¯ÍÐ
£¨1£© ίÍÐʱһÖÖÒýÓ÷½·¨µÄÀàÐÍ£¬Ò»µ©ÎªÎ¯ÍзÖÅäÁË·½·¨£¬Î¯Íн«Óë¸Ã·½·¨¾ßÓÐÍêÈ«ÏàͬµÄÐÐΪ£¬Î¯Íз½·¨µÄ´øŶÓÿÉÒÔÏñ
ÆäËû·½·¨Ò»Ñù£¬¾ßÓвÎÊýºÍ·µ»ØÖµ£¬
È磺 public delegate int PerformCa ......
Èý²ã¼Ü¹¹(3-tier application) ͨ³£ÒâÒåÉϵÄÈý²ã¼Ü¹¹¾ÍÊǽ«Õû¸öÒµÎñÓ¦Óû®·ÖΪ£º±íÏֲ㣨UI£©¡¢ÒµÎñÂß¼²ã£¨BLL£©¡¢Êý¾Ý·ÃÎʲ㣨DAL£©¡£Çø·Ö²ã´ÎµÄÄ¿µÄ¼´ÎªÁË“¸ßÄÚ¾Û£¬µÍñîºÏ”µÄ˼Ïë¡£
1¡¢±íÏֲ㣨UI£©£ºÍ¨Ë×½²¾ÍÊÇÕ¹ÏÖ¸øÓû§µÄ½çÃ棬¼´Óû§ÔÚʹÓÃÒ»¸öϵͳµÄʱºòËûµÄËù¼ûËùµÃ¡£
2¡¢ÒµÎñ ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeftMenu.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xht ......
Èý¡¢ÈçºÎ£ºÉèÖà ASP.NET Web ·þÎñÆ÷¿Ø¼þÊôÐÔ
ÔÚ ASP.NET ÍøÒ³ÖУ¬¸ù¾ÝËùÐèµÄÊôÐÔ (Property) ÉèÖÿؼþÉùÃ÷µÄÊôÐÔ (Attribute)¡£
ÄúËùÉèÖõÄÈ·ÇÐÊôÐÔÈ¡¾öÓڿؼþºÍÊôÐÔ¡£ÓйØÌض¨¿Ø¼þµÄÊôÐÔµÄÐÅÏ¢£¬ÇëÔÚ“°ïÖú”Ë÷ÒýÖÐËÑË÷¸Ã¿Ø¼þÀàµÄÃû³Æ£¨ÀýÈ磬“Button Àà (System.Web.UI ......