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

asp.net·Ö²¿Àà(Partial Classes)

·Ö²¿Àà(Partial Classes)
C# 2.0 ¿ÉÒÔ½«Àà¡¢½á¹¹»ò½Ó¿ÚµÄ¶¨Òå²ð·Öµ½Á½¸ö»ò¶à¸öÔ´ÎļþÖУ¬ÔÚÀàÉùÃ÷Ç°Ìí¼Ópartial¹Ø¼ü×Ö¼´¿É¡£
ÀýÈ磺ÏÂÃæµÄPartialTestÀà
class PartialTest
{
string Str_FieldTest;
int Int_FieldTest;
public void DoTest()
{
Debug.Print("Test");
}
}
¿ÉÔÚ²»Í¬Ô´ÎļþÖÐд³ÉÏÂÃæÐÎʽ£º
Ò»¸öÎļþÖÐд£º
partial class PartialTest
{
string Str_FieldTest;
int Int_FieldTest;
}
ÁíÒ»¸öÎļþÖÐд£º
partial class PartialTest
{
public void DoTest()
{
Debug.Print("Test");
}
}
 
ʲôÇé¿öÏÂʹÓ÷ֲ¿Àࣿ
–        ´¦Àí´óÐÍÏîĿʱ£¬Ê¹Ò»¸öÀà·Ö²¼ÓÚ¶à¸ö¶ÀÁ¢ÎļþÖпÉÒÔÈöàλ³ÌÐòԱͬʱ¶Ô¸ÃÀà½øÐд¦Àí£¨Ï൱ÓÚÖ§³Ö²¢Ðд¦Àí£¬ºÜʵÓã©£»
–        ʹÓÃ×Ô¶¯Éú³ÉµÄԴʱ£¬ÎÞÐèÖØд´½¨Ô´Îļþ±ã¿É½«´úÂëÌí¼Óµ½ÀàÖС£Visual Studio ÔÚ´´½¨Windows ´°Ìå¡¢Web ´°Ìåʱ¶¼Ê¹Óô˷½·¨¡£Äã²»Óñ༭Visual Studio Ëù´´½¨µÄÎļþ£¬±ã¿É´´½¨Ê¹ÓÃÕâЩÀàµÄ´úÂë¡£»»¾ä»°Ëµ£ºÏµÍ³»á×Ô¶¯´´½¨Ò»¸öÎļþ£¨Ò»°ã¼Ç¼µÄÊÇ´°Ìå¼°´°ÌåÖеĿؼþµÄÊôÐÔ£©£¬ÁíÒ»¸ö»ò¼¸¸öÎļþ¼Ç¼µÄÊÇÓû§×Ô¼º±àдµÄ´úÂë¡£ÕâÁ½²¿·Ö·Ö¿ª¿ÉÒÔʹ½á¹¹ÏԵ÷dz£ÇåÎú£¬Óû§Ö»Ðè¹Ø×¢×Ô¼º¸ºÔðµÄÄDz¿·Ö¾ÍÐÐÁË£¨ÐèÒªµÄ»°£¬ÕâÁ½²¿·Ö¿ÉÒÔ»¥Ïàµ÷Óã©¡£µÈµ½Á˱༭ÔËÐеÄʱºò£¬ÏµÍ³»á×Ô¶¯½«ÕâÁ½²¿·ÖºÏ³ÉÒ»¸öÎļþ¡£
ʹÓÃPartialÐèҪעÒâÒÔÏÂһЩÇé¿ö£º
1.      ʹÓÃpartial ¹Ø¼ü×Ö±íÃ÷¿ÉÔÚÃüÃû¿Õ¼äÄÚ¶¨Òå¸ÃÀà¡¢½á¹¹»ò½Ó¿ÚµÄÆäËû²¿·Ö
2.      ËùÓв¿·Ö¶¼±ØÐëʹÓÃpartial ¹Ø¼ü×Ö
3.      ¸÷¸ö²¿·Ö±ØÐë¾ßÓÐÏàͬµÄ¿É·ÃÎÊÐÔ£¬Èçpublic¡¢private µÈ
4.      Èç¹û½«ÈÎÒⲿ·ÖÉùÃ÷Ϊ³éÏóµÄ£¬ÔòÕû¸öÀàÐͶ¼±»ÊÓΪ³éÏóµÄ
5.      Èç¹û½«ÈÎÒⲿ·ÖÉùÃ÷ΪÃÜ·âµÄ£¬ÔòÕû¸öÀàÐͶ¼±»ÊÓΪÃÜ·âµÄ
6.      Èç¹ûÈÎÒⲿ·ÖÉùÃ÷¼Ì³Ð»ùÀàʱ£¬ÔòÕû¸öÀàÐͶ¼½«¼Ì³Ð¸ÃÀà
7.      ¸÷¸ö²¿·Ö¿ÉÒÔÖ¸¶¨²»Í¬µÄ»ù½Ó¿Ú£¬×îÖÕÀàÐͽ«ÊµÏÖËùÓзֲ¿ÉùÃ÷ËùÁгöµÄÈ«²¿½Ó¿Ú
8.      ÔÚijһ·Ö²¿¶¨ÒåÖÐÉùÃ÷µÄÈκÎÀà¡¢½á¹¹»ò½Ó¿Ú³ÉÔ±¿É¹©ËùÓÐÆäËû²¿·ÖʹÓÃ
9£®Ç¶Ì×ÀàÐÍ¿ÉÒÔÊÇ·Ö²¿µÄ£¬¼´Ê¹ËüÃÇËùǶÌ×ÓÚµÄÀàÐͱ


Ïà¹ØÎĵµ£º

asp.netÊý¾Ý¿â²Ù×÷Àà(´æ´¢¹ý³Ì´¦Àí)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.ComponentModel;
namespace SQLHelper
{
 /// <summary>
 /// Class1 µÄժҪ˵Ã÷¡£
 /// </summary>
 public class SQLHelper
 {
  // Á¬½ÓÊý¾ÝÔ´
......

ASP.NET JS³£Ó÷½·¨Àà

using System.Web;
/// <summary>
/// Javascript³£Ó÷½·¨
/// </summary>
public class JS
{
    private static string ScriptStart = "<script type=\"text/javascript\">";
    private static string ScriptEnd = "</script>";
  &n ......

ASP.NETÖÐΪGridViewÌí¼Óɾ³ýÌáʾ¿ò

ÔÚGridViewÖÐÎÒÃÇ¿ÉÒÔÖ±½ÓÌí¼ÓÒ»¸öCommandFieldɾ³ýÁÐÀ´É¾³ýijÐÐÐÅÏ¢¡£µ«ÎªÁ˱ÜÃâÎó²Ù×÷ÒýÆðµÄÎóɾ³ý£¬ÔÚɾ³ý²Ù×÷ÕßÈòÙ×÷ÕßÔÙÈ·ÈÏÏ£¬ÍêºóÔÙ½øÐÐɾ³ý¡£
¡¡¡¡Ê×ÏÈÎÒÃǸøÎÒÃǵÄGridView Ìí¼ÓÒ»¸öÄ£°åÁУ¬ÈçÏ£º
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
£¼ASP:TemplateField HeaderText="Delete" ShowHeader="False"£¾
£¼ItemStyle ......

ASP.NET ÈçºÎÈ¡µÃ Request URL µÄ¸÷個²¿·Ö?


ÎÒ們ÔÚ開發網頁應ÓóÌʽ£¬時³£ÐèҪȥ½âÎö網Ö·(Request.Url)µÄÿ個Ƭ¶Î£¬進ÐÐһЩÅÐ斷¡£ÀýÈç說 "http://localhost:1897/News/Press/Content.aspx/123?id=1#toc
"£¬ÎÒ們ÏëҪȡµÃ網Ö·裡µÚÒ»層Ä¿錄µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ