ASP.NET ÃæÊÔÌ⠺ϼ¯
1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£
´ð . private : ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£
protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£
public : ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£
internal: ÔÚͬһÃüÃû¿Õ¼äÄÚ¿ÉÒÔ·ÃÎÊ¡£
2 .ÁоÙASP.NET Ò³ÃæÖ®¼ä´«µÝÖµµÄ¼¸ÖÖ·½Ê½¡£
´ð. 1.ʹÓÃQueryString, Èç....?id=1; response. Redirect()....
2.ʹÓÃSession±äÁ¿
3.ʹÓÃServer.Transfer
3. Ò»ÁÐÊýµÄ¹æÔòÈçÏÂ: 1¡¢1¡¢2¡¢3¡¢5¡¢8¡¢13¡¢21¡¢34...... ÇóµÚ30λÊýÊǶàÉÙ£¬ ÓõݹéË㷨ʵÏÖ¡£
´ð£ºpublic class MainClass
{
public static void Main()
{
Console.WriteLine(Foo(30));
}
public static int Foo(int i)
{
if (i <= 0)
return 0;
else if(i > 0 && i <= 2)
return 1;
else return Foo(i -1) + Foo(i - 2);
}
}
4.C#ÖеÄίÍÐÊÇʲô£¿Ê¼þÊDz»ÊÇÒ»ÖÖίÍУ¿
´ð £º
ίÍпÉÒÔ°ÑÒ»¸ö·½·¨×÷Ϊ²ÎÊý´úÈëÁíÒ»¸ö·½·¨¡£
ίÍпÉÒÔÀí½âΪָÏòÒ»¸öº¯ÊýµÄÒýÓá£
ÊÇ£¬ÊÇÒ»ÖÖÌØÊâµÄίÍÐ
5.overrideÓëÖØÔصÄÇø±ð
´ð £º
override ÓëÖØÔصÄÇø±ð¡£ÖØÔØÊÇ·½·¨µÄÃû³ÆÏàͬ¡£²ÎÊý»ò²ÎÊýÀàÐͲ»Í¬£¬½øÐжà´ÎÖØÔØÒÔÊÊÓ¦²»Í¬µÄÐèÒª
Override ÊǽøÐлùÀàÖк¯ÊýµÄÖØд¡£ÎªÁËÊÊÓ¦ÐèÒª¡£
6.Èç¹ûÔÚÒ»¸öB/S½á¹¹µÄϵͳÖÐÐèÒª´«µÝ±äÁ¿Öµ£¬µ«ÊÇÓÖ²»ÄÜʹÓÃSession¡¢Cookie¡¢Application£¬ÄúÓм¸ÖÖ·½·¨½øÐд¦Àí£¿
´ð £º
this.Server.Transfer
7.Çë±à³Ì±éÀúÒ³ÃæÉÏËùÓÐTextBox¿Ø¼þ²¢¸øËü¸³ÖµÎªstring.Empty£¿
´ð£º
foreach (System.Windows.Forms.Control control in this.Controls)
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ;
tb.Text = String.Empty ;
}
}
8.Çë±à³ÌʵÏÖÒ»¸öðÅÝÅÅÐòËã·¨£¿
´ð£º
int [] array = new int
;
int temp = 0 ;
for (int i = 0 ; i < array.Length - 1 ; i++)
{
for (int j = i + 1 ; j < array.Length ; j++)
{
if (array[j] < array[i])
{
temp = array[i] ;
array[i] = array[j] ;
array[j] = temp ;
}
}
}
9.Ã
Ïà¹ØÎĵµ£º
ÔÚweb³ÌÐòÖУ¬¾³£»áʹÓÃÔÚÒ»¸öÍøҳʹÓÃÆäËûÍøÒ³Ìá½»µÄÊý¾ÝÐÅÏ¢£¬ÕâÀï¿ÉÒÔʹÓÃRequestÄÚÖöÔÏóÀ´Íê³É£¬À´»ñÈ¡Óû§Ìá½»µÄÐÅÏ¢£¬¸ù¾Ý¿Í»§¶ËÌá½»Êý¾Ý·½Ê½µÄ²»Í¬£¬Request¶ÔÏó·Ö±ðʹÓÃFormºÍQueryString¼¯ºÏÊôÐÔÀ´»ñÈ¡Êý¾Ý¡£ÏÂÃæÊÇÁ½ÖÖ¼¯ºÏ»ñÈ¡·½Ê½µÄ²»Í¬µã£ºÍ¨¹ýForm»ñÈ¡Êý¾ÝʱÔÚformÊôÐÔÖмòµ¥µÄÌí¼Óaction=“ÌøתµÄÍøÒ³ ......
The MVC bits have finally arrived and I’ve spent a while digesting them. I’ve been waiting for the bits to be released to begin working on a side-project, so the first thing I did after downloading them last night was crank it up and start working on a new ASP.NET MVC Web Application p ......
Ó¦ÓÃ1£ºGridViewºÍCheckBox½áºÏ
Ч¹ûͼ£º
Ó¦ÓÃ2£ºExtending the GridView Control
Code download available at: CuttingEdge05.exe (132 KB)
Browse the Code Online
Contents
The GridView Difference
A New GridView Control
Adding a Checkbox Column
The New Grid In Action
Styling Selected ......
ģ̬´°¿Úÿ´ÎÒ³ÃæÖØдò¿ª²»Ë¢Ð¡£
»º´æµÄÔÒò£¬¸Ä³ÉÕâÑù£º
½â¾ö°ì·¨¡£¡£¡£
url = frmWin + "? " + Math.random();
window.showModalDialog(url,me, 'dialogWidth= '+width + 'px;dialogHeight= '+height+ 'px;help:no;status:no;resizable:no;scro ll:no; ......