asp.net»ñÈ¡µ±Ç°Ê±¼ä
ÔÚc# / ASP.netÖÐÎÒÃÇ¿ÉÒÔͨ¹ýʹÓÃDataTimeÕâ¸öÀàÀ´»ñÈ¡µ±Ç°µÄʱ¼ä¡£Í¨¹ýµ÷ÓÃÀàÖеĸ÷ÖÖ·½·¨ÎÒÃÇ¿ÉÒÔ»ñÈ¡²»Í¬µÄʱ¼ä£ºÈ磺ÈÕÆÚ£¨2008-09-04£©¡¢Ê±¼ä£¨12£º12£º12£©¡¢ÈÕÆÚ+ʱ¼ä£¨2008-09-04 12£º11£º10£©µÈ¡£
//»ñÈ¡ÈÕÆÚ+ʱ¼ä
DateTime.Now.ToString(); // 2008-9-4 20:02:10
DateTime.Now.ToLocalTime().ToString(); // 2008-9-4 20:12:12
//»ñÈ¡ÈÕÆÚ
DateTime.Now.ToLongDateString().ToString(); // 2008Äê9ÔÂ4ÈÕ
DateTime.Now.ToShortDateString().ToString(); // 2008-9-4
DateTime.Now.ToString("yyyy-MM-dd"); // 2008-09-04
DateTime.Now.Date.ToString(); // 2008-9-4 0:00:00
//»ñȡʱ¼ä
DateTime.Now.ToLongTimeString().ToString(); // 20:16:16
DateTime.Now.ToShortTimeString().ToString(); // 20:16
DateTime.Now.ToString("hh:mm:ss"); // 08:05:57
DateTime.Now.TimeOfDay.ToString(); // 20:33:50.7187500
//ÆäËû
DateTime.ToFileTime().ToString(); // 128650040212500000
DateTime.Now.ToFileTimeUtc().ToString(); // 128650040772968750
DateTime.Now.ToOADate().ToString(); // 39695.8461709606
DateTime.Now.ToUniversalTime().ToString(); // 2008-9-4 12:19:14
DateTime.Now.Year.ToString(); »ñÈ¡Äê·Ý // 2008
DateTime.Now.Month.ToString(); »ñÈ¡ÔÂ·Ý // 9
DateTime.Now.DayOfWeek.ToString(); »ñÈ¡ÐÇÆÚ // Thursday
DateTime.Now.DayOfYear.ToString(); »ñÈ¡µÚ¼¸Ìì // 248
DateTime.Now.Hour.ToString(); »ñȡСʱ // 20
DateTime.Now.Minute.ToString(); »ñÈ¡·ÖÖÓ // 31
DateTime.Now.Second.ToString(); »ñÈ
Ïà¹ØÎĵµ£º
Controller needs to derive from Mvc.Controller
each controller function is assiaciaed with a default view by name
controller and viewer can exchange data by viewdata
use HTML.ActionLink to add a link on html page
a url is corresponding to a action method
in view, using HTML.BeginForm() will gen ......
1¡£Ê×ÏÈÊÇ»ù±¾ÔÀí£¬±ÈÈç˵ÊÇlife cycle£¬Êý¾Ý¿â²Ù×÷µÈ¡£
2¡£Êµ¼ÊÏîÄ¿µÄʵ¼ù£¬Ç°Ò»½×¶ÎµÄ¹¤×÷ÔÚÕâ¸ö½×¶Î¼ìÑ飬ºÃÏñ×ö¸öÍøվûÓÐÏëÏóµÄÄÇô¼òµ¥¡£
3¡£Ñо¿Êµ¼ÊµÄ°¸ÀýºÍ¿ªÔ´¿ò¼Ü£¬µ½ÕâÀï²ÅÃ÷°×£¬ÔÀ´ÍøÕ¾ÕâôµÄ×öµÄ£¬ºÃÏñÊÇûÓÐÄÇôÄÑ°¡¡£
¼òµ¥µÄдд£¬¼Ç¼ÔÚʵ¼ÊÏîÄ¿ÖеĸÐÎò¡£ÓÚ2010-5-30Íí£¬¾ãÀÖ²¿¡£ ......
Web ÊÇ»ùÓÚÎÞ״̬µÄhttpÐÒ飬ASP.NET ΪÁ˱£Ö¤¿Ø¼þÔÚÒ³Ãæ´«Ë͵½·þÎñÆ÷£¬ÔÙ´Ó·þÎñÆ÷·¢»Øµ½Ò³ÃæµÄʱ±£³Ö֮ǰµÄ״̬¡£
´úÂë×¼±¸£º
ÔÚaspxÒ³ÃæÉÏÌí¼ÓÒ»¸ölistbox¿Ø¼þ£¬ºÍÒ»¸öbutton·þÎñÆ÷¿Ø¼þ£º
<
asp:ListBox runat
=
"
server
"
ID
=
"
lbViewState
"
></
asp ......
ÎÊÌâÃèÊö£º
Asp.NetÖÐdatalistµÈweb¿Ø¼þÀïÃ棬·Å¶à¸öµ¥Ñ¡°´Å¥µÄʱºò¿ÉÒÔͬʱ¶àÑ¡¡£
ÎÊÌâ½â¾ö£º
×îÀíÏëµÄ½â¾öÖ®µÀ£¬ÓÃjavascript£º
<script language="javascript" type="text/javascript">
function clickit() {
var dom=document.all;
& ......