Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Asp.NetÖж¯Ì¬¼ÓÔؿؼþ


ÎÒÃÇÔÚAsp.Net¿ª·¢¹ý³ÌÖУ¬ÓÐʱºòΪÁË¿ª·¢µÄÐèÒª£¬»ò´ïµ½Ò»¶¨µÄЧ¹û£¬ÎÒÃÇ»á²ÅÈ¡¶¯Ì¬¼ÓÔØÓû§¿Ø¼þµÄ·½·¨À´ÊµÏÖ£¬¶¯Ì¬¼ÓÔØÓû§¿Ø¼þ£¬¿ÉÒÔÔÚͬһ¸öÒ³ÃæÀïÃ棬¸ù¾Ý²»Í¬µÄÇé¿öÏÔʾ²»Í¬µÄÄÚÈÝ£¬Ê¹ÎÒÃÇÔÚ¿ª·¢Ê¡Ê±Ê¡Á¦¡£
¡¡ÄÇôÎÒÃÇÔõôʵÏÖ¶¯Ì¬¼ÓÔØÓû§¿Ø¼þÄØ£¬ÆäʱºÜ¼òµ¥£¬ÎÒÃÇÖ»ÒªÔÚÒ³ÃæÀïÒª·Å¿ØµÄ¼þµÄµØ·½·ÅÒ»¸öռλ¿Ø¼þ <asp:PlaceHolder ID="phContent" runat="server"></asp:PlaceHolder> £¬Õâ¸ö¿Ø¼þÊÇAsp.Net×Ô´øµÄ£¬È»ºóÔÚ³ÌÐòÓþͿÉÒԺܼòµ¥µØʵÏÖÁË£¬³ÌÐòÈçÏ£º
      Control Ctr = Page.LoadControl("UserControl/Control.ascx");  //¼ÓÔؿؼþ
      Ctr.ID = "ControlName";  //ÉêÃ÷¿Ø¼þÃû
      phContent.EnableViewState = false;  //Ö¸¶¨ÊÇ·ñÆôÓÃViewState
      phContent.Controls.Add(Ctr); //Êä³ö¿Ø¼þ
    µ±È»£¬²»Ò»¶¨Ö»ÓÐÓû§¿Ø¼þ¿ÉÒÔÕâÑùʵÏÖ£¬ÆäËüµÄ¿Ø¼þÒ²¶¼¿ÉÒÔÀàËƵØʵÏÖ¡£
    ÔÚASP.NETÖж¯Ì¬¼ÓÔØÄÚÈÝ£¨Óû§¿Ø¼þºÍÄ£°å£©
Òªµã£º
1£® ʹÓÃPage.ParseControl
2£® ʹÓÃbase.LoadControl
µÚÒ»²¿·Ö£º¼ÓÔØÄ£°å
ÏÂÃæÊÇÒ»¸öÄ£°å“<table width=100%><tr><td width=100% colspan=2 runat=server id=ContainerTop></td></tr><tr><td width=30% runat=server id=ContainerLeft></td><td width=70% runat=server id=ContainerRight></td></tr></table>”ÈçºÎ°ÑËüÌí¼Óµ½Ò³ÃæÖÐÄÇ¡£¡¡
Ê×ÏÈ£¬ÄãÒªÓÐÒ»¸öÒ³Ã棨.aspx£©£¬ÔÚÒ³ÃæÖÐÓÐÒ»¸öÒ»ÐÐÒ»Áеıí¸ñ£¬²¢ÇÒÊÇ·þÎñÆ÷¶ËµÄTDÎÒÃǾͰÑËüÃüÃûΪTemplateContainer¡£ºÃÁËÏÖÔÚµ½´úÂë±à¼­´°¿Ú£¬ÔÚpage_loadÖмÓÔØÄ£°å¡£
µÚ¶þ²½£¬Ê¹ÓÃPage.ParseControl½«ÉϱߵÄHTML´úÂë·ÖÎöΪweb´°ÌåÒ³»òÓû§¿Ø¼þµÄSystem.web.ui.controlÈçÏ´úÂ룺
protected System.Web.UI.HtmlControls.HtmlTableCell TemplateContainer;
System.Web.UI.Control objContainer;
private void Page_Load(object sender, System.EventArgs e)
{
objContainer =Page.ParseControl(“ÉϱߵÄHTML´úÂë);
this.TempContainer.Controls.Add(objContainer);
}
Ä£°åÒѾ­¼ÓÔØÍê±Ï¡£
µÚ¶þ²¿·Ö£º¼ÓÔØÓû§¿Ø¼þ
Ê×ÏÈ£¬ÄãҪȷ¶¨Óû§¿Ø¼þÒª¼ÓÔص


Ïà¹ØÎĵµ£º

ASP.NETÖиù¾ÝÄ£°åÉú³É¾²Ì¬Ò³!

  template.htmÄ£°åÒ³Ô´Âë:
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. <html xmlns="http://www.w3.org/1999/xhtml" >
3. <head>
4. <title ......

ASP.NET Literal¿Ø¼þÓ÷¨

ASP.NET Literal¿Ø¼þÓ÷¨_»ªÎª½ðɽÍø
ÔÚÄúÒªÒÔ±à³Ì·½Ê½ÉèÖÃÎı¾¶ø²»Ìí¼Ó¶îÍâµÄ HTML ±ê¼Çʱ£¬¿ÉÒÔÏòÒ³ÃæÌí¼Ó Literal Web ·þÎñÆ÷¿Ø¼þ¡£ÔÚÒªÏòÒ³Ã涯̬Ìí¼ÓÎı¾¶ø²»Ìí¼ÓÈκβ»ÊôÓڸö¯Ì¬Îı¾µÄÔªËØʱ£¬Literal ¿Ø¼þ·Ç³£ÓÐÓá£ÀýÈ磬Äú¿ÉÒÔʹÓà Literal ¿Ø¼þÀ´ÏÔʾ´ÓÎļþ»òÁ÷ÖжÁÈ¡µÄ HTML¡£
×¢Òâ
Èç¹ûÒªÏÔʾ¾²Ì¬Îı¾£¬ ......

Asp.net tabcontrol

ÏÂÃæ½éÉÜʵÏÖ·½·¨£º
Ò»¡¢ÍÏÀ­Ò»¸öMenu¿Ø¼þ
Õâ¸ö¿Ø¼þÊǸºÔð¿Ø¼þ¸÷¸öÑ¡ÏµÄ£¬Ò²¾ÍÊÇ×îÖÕ³ÊÏÖÔÚÓû§ÃæÇ°µÄ½çÃ棬²¢ÇÒÎÒÃÇÖ¸¶¨Ã¿¸öÑ¡ÏµÄͼƬ¡£
´úÂ룺
<asp:Menu ID="Menu1" runat="server" onmenuitemclick="Menu1_MenuItemClick"
            Orientati ......

ASP.NET 2.0ÖÐÖ±½ÓµÃµ½±¾Ò³ÃæÉú³ÉµÄHTML´úÂë


ÔÚASP.NET 2.0ÖУ¬ÓÐʱºòÐèÒª¶ÔASP.NETÉú³ÉµÄHTML´úÂë½øÐд¦Àí£¬»òÕßÊDZ£´æ³É¾²Ì¬Îļþ¡£ASP.NET Ìá
¹©ÁËÖ±½Ó½«ÇëÇó±£´æ³ÉÎļþµÄ·½·¨£ºHttpRequest.SaveAs·½·¨¡£ÏÂÃæÕâ¸ö·½·¨¾ÍÊÇÔÚASP.NET 2.0Öеõ½
ASP.NETÉú³ÉµÄHTML´úÂ룬ͬʱ£¬Éú³ÉÒ»¸ö¾²Ì¬ÎļþµÄ·½·¨¡£
C#
<%@ Page Language="C#" AutoEventWireup="true" %&g ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ