Asp.netÈÕÆÚ×Ö·û´®¸ñʽ»¯ÏÔʾ
Asp.netÈÕÆÚ×Ö·û´®¸ñʽ»¯ÏÔʾ--DateTime.ToString()Ó÷¨Ïê½â
ÎÒÃǾ³£»áÓöµ½¶Ôʱ¼ä½øÐÐת»»,´ïµ½²»Í¬µÄÏÔʾЧ¹û£¬Ä¬ÈϸñʽΪ:2006-6-6 14:33:34
Èç¹ûÒª»»³É³É200606,06-2006,2006-6-6»ò¸ü¶àµÄ¸ñʽ¸ÃÔõô°ìÄØ£¿
ÕâÀォҪÓõ½:DateTime.ToStringµÄ·½·¨(String, IFormatProvider)
ʾÀý£º
using System;
using System.Globalization;
String format="D";
DateTime date=DataTime.Now;
Response.Write(date.ToString(format, DateTimeFormatInfo.InvariantInfo));
½á¹ûÊä³ö
Thursday, June 16, 2006
ÔÚÕâÀïÁгöÁ˲ÎÊýformat¸ñʽÏêϸÓ÷¨
=======================
¸ñʽ×Ö·û ¹ØÁªÊôÐÔ/˵Ã÷
d ShortDatePattern
D LongDatePattern
f ÍêÕûÈÕÆÚºÍʱ¼ä£¨³¤ÈÕÆںͶÌʱ¼ä£©
F FullDateTimePattern£¨³¤ÈÕÆںͳ¤Ê±¼ä£©
g ³£¹æ£¨¶ÌÈÕÆںͶÌʱ¼ä£©
G ³£¹æ£¨¶ÌÈÕÆںͳ¤Ê±¼ä£©
m¡¢M MonthDayPattern
r¡¢R RFC1123Pattern
s ʹÓõ±µØʱ¼äµÄ SortableDateTimePattern£¨»ùÓÚ ISO 8601£©
t ShortTimePattern
T LongTimePattern
u UniversalSortableDateTimePattern ÓÃÓÚÏÔʾͨÓÃʱ¼äµÄ¸ñʽ
U ʹÓÃͨÓÃʱ¼äµÄÍêÕûÈÕÆÚºÍʱ¼ä£¨³¤ÈÕÆںͳ¤Ê±¼ä£©
y¡¢Y YearMonthPattern
ϱíÁгöÁ˿ɱ»ºÏ²¢ÒÔ¹¹Ôì×Ô¶¨ÒåģʽµÄģʽ
========================================
ÕâЩģʽÊÇÇø·Ö´óСдµÄ£»ÀýÈ磬ʶ±ð“MM”£¬µ«²»Ê¶±ð“mm”¡£Èç¹û×Ô¶¨Òåģʽ°üº¬¿Õ°××Ö·û»òÓõ¥ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û£¬ÔòÊä³ö×Ö·û´®Ò³Ò²½«°üº¬ÕâЩ×Ö·û¡£Î´¶¨ÒåΪ¸ñʽģʽµÄÒ»²¿·Ö»ò䶨ÒåΪ¸ñʽ×Ö·ûµÄ×Ö·û°´ÆäÔÒ帴ÖÆ¡£
¸ñʽģʽ ˵Ã÷ £º
d ÔÂÖеÄijһÌ졣һλÊýµÄÈÕÆÚûÓÐÇ°µ¼Áã¡£
dd ÔÂÖеÄijһÌ졣һλÊýµÄÈÕÆÚÓÐÒ»¸öÇ°µ¼Áã¡£
ddd ÖÜÖÐijÌìµÄËõдÃû³Æ£¬ÔÚ AbbreviatedDayNames Öж¨Òå¡£
dddd ÖÜÖÐijÌìµÄÍêÕûÃû³Æ£¬ÔÚ DayNames Öж¨Òå¡£
M Ô·ÝÊý×Ö¡£Ò»Î»ÊýµÄÔ·ÝûÓÐÇ°µ¼Áã¡£
MM Ô·ÝÊý×Ö¡£Ò»Î»ÊýµÄÔ·ÝÓÐÒ»¸öÇ°µ¼Áã¡£
MMM Ô·ݵÄËõдÃû³Æ£¬ÔÚ AbbreviatedMonthNames Öж¨Òå¡£
MMMM Ô·ݵÄÍêÕûÃû³Æ£¬ÔÚ MonthNames Öж¨Òå¡£
y ²»°üº¬¼ÍÔªµÄÄê·Ý¡£Èç¹û²»°üº¬¼ÍÔªµÄÄê·ÝСÓÚ 10£¬ÔòÏÔʾ²»¾ßÓÐÇ°µ¼ÁãµÄÄê·Ý¡£
yy ²»°üº¬¼ÍÔªµÄÄê·Ý¡£Èç¹û²»°üº¬¼ÍÔªµÄÄê·ÝСÓÚ 10£¬ÔòÏÔʾ¾ßÓÐÇ°µ¼ÁãµÄÄê·Ý¡£
yyyy °üÀ¨¼ÍÔªµÄËÄλÊýµÄÄê·Ý¡£
gg ʱÆÚ»ò¼ÍÔª¡£Èç¹ûÒªÉèÖøñʽµÄÈÕÆÚ²»¾ßÓйØÁªµÄʱÆÚ»ò¼ÍÔª×Ö·û´®£¬ÔòºöÂÔ¸Ãģʽ¡£
Ïà¹ØÎĵµ£º
ÓÐʱºòÄãÏëÔÚµ÷ÓÃaction·½·¨Ö®Ç°»òÕßaction·½·¨Ö®ºó´¦ÀíһЩÂß¼£¬ÎªÁËÖ§³ÖÕâ¸ö£¬ASP.NET MVCÔÊÐíÄã´´½¨action¹ýÂËÆ÷¡£Action¹ýÂËÆ÷ÊÇ×Ô¶¨ÒåµÄAttributes£¬ÓÃÀ´±ê¼ÇÌí¼ÓAction·½·¨Ö®Ç°»òÕßAction·½·¨Ö®ºóµÄÐÐΪµ½¿ØÖÆÆ÷ÀàÖеÄAction·½·¨ÖС£
һЩ¿ÉÄÜÓõ½Action¹ýÂËÆ÷µÄµØ·½ÓУº
ÈÕÖ¾,Òì³£´¦Àí
Éí·ÝÑéÖ¤ºÍÊÚȨ £ ÏÞÖ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attribute ......
¡ï1. ʹÓÃQueryString±äÁ¿
¡¡¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspxµÄC#´úÂë
private vo ......
asp,asp.net,php,jspϵÄ301תÏò´úÂë
ʹÓÃ.htaccessÎļþÀ´½øÐÐ301Öض¨Ïò¡£
Èç¹û¿Õ¼ä²»Ö§³Ö.htaccessÎļþ£¬ÄÇôÎÒÃÇ»¹¿ÉÒÔͨ¹ýphp/asp´úÂëÀ´½øÐÐ301Öض¨Ïò¡£
ΪÁ˽«ËÑË÷ÒýÇæµÄ¼Ç¼¸üе½ÏÖÔÚµÄÓòÃûÉÏÃæ,×öÁ˼¸¸ö301Öض¨ÏòµÄ¶«¶«,¸ø´ó¼Ò·ÖÏíÒ»ÏÂ.
asp 301תÏò´úÂë
ÔÚ index.asp »ò default.asp µÄ×²¿¼ÓÈëÒÔ ......