ÔÚasp.netÖлسµ´¥·¢Ö¸¶¨°´Å¥µÄʼþ
½ñÌìÔÚ¿ª·¢ÖУ¬Óöµ½ÁËÒ»¸öÎÊÌ⣺
ÔÚHeaderÖÐÓÐÒ»¸öËÑË÷ÊäÈë¿ò£¬ËÑË÷°´Å¥ÊÇButton¿Ø¼þ£¬ÔÚ“×ÊѶÎÄÕÂËÑË÷”Óû§×Ô¶¨Òå¿Ø¼þÖÐÒ²Óõ½ÁËButton¿Ø¼þ¡£
½«½¹µãÍ£ÔÚ“×ÊѶ±êÌâ»òÄÚÈÝ”ÊäÈë¿òÖУ¬»Ø³µ£¬µ«ÊÇÏàÓ¦µÄÊÇHeaderÖÐÊäÈë¿òÄÚÈÝ¡£
ÔÒò£º»Ø³µÖ´ÐеľÍÊÇÄãÒ³ÃæÉϵĵÚÒ»¸ösubmit button¡£½â¾ö·½·¨£º£¨ÒÔÏÂÒÔ×ÊѶËÑË÷ÊäÈë¿òΪÀý£©
1¡¢js£º
----------------------------------------------------------------------------
/* »Ø³µºóÖ´Ðа´Å¥ */
function SubmitKeyClick(button){
if (event.keyCode == 13){
event.keyCode = 9;
event.returnValue = false;
document.all[button].click();
}
}
function checkinputbox(){
var charBag = "[^`~@#$%^&/\'|*]";
var searchkey = document.getElementById("ArticleSearch1_txtSearchKey");
if (trim(searchkey.value).length == 0 || trim(searchkey.value).length > 30){
alert("×ÊѶÎÄÕ¹ؼü×Ö²»Äܶ¼Îª¿Õ»ò³¤¶È²»Äܳ¬¹ý¸ö×Ö·û£¡");
searchkey.focus();
return false;
}
if (trim(searchkey.value) != ""){
for (var i = 0; i < searchkey.value.length; i++) {
var c = searchkey.value.charAt(i);
if (charBag.indexOf(c) > -1) {
alert("ËÑË÷×ÊѶÎÄÕ¹ؼü×Ö×Ö·û´®Öк¬ÓзǷ¨×Ö·û(" + c +")£¡");
&nbs
Ïà¹ØÎĵµ£º
ÓÐʱºòÄãÏëÔÚµ÷ÓÃaction·½·¨Ö®Ç°»òÕßaction·½·¨Ö®ºó´¦ÀíһЩÂß¼£¬ÎªÁËÖ§³ÖÕâ¸ö£¬ASP.NET MVCÔÊÐíÄã´´½¨action¹ýÂËÆ÷¡£Action¹ýÂËÆ÷ÊÇ×Ô¶¨ÒåµÄAttributes£¬ÓÃÀ´±ê¼ÇÌí¼ÓAction·½·¨Ö®Ç°»òÕßAction·½·¨Ö®ºóµÄÐÐΪµ½¿ØÖÆÆ÷ÀàÖеÄAction·½·¨ÖС£
һЩ¿ÉÄÜÓõ½Action¹ýÂËÆ÷µÄµØ·½ÓУº
ÈÕÖ¾,Òì³£´¦Àí
Éí·ÝÑéÖ¤ºÍÊÚȨ £ ÏÞÖ ......
Global.asax Îļþ£¬ÓÐʱºò½Ð×ö ASP.NET Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦Óà ......
1
private void Focus(string sDomID)
{
RegScript("focus", "document.getElementById(\"" + sDomID + "\").focus();");
  ......
ÌõÐÎÂëÊÇÆù½ñΪֹ×á¢ÊµÓõÄÒ»ÖÖ×Ô¶¯Ê¶±ð¼¼Êõ¡£ÌõÐÎÂë¼¼Êõ¾ßÓÐÒÔϼ¸¸ö·½ÃæµÄÓŵã
¡¡¡¡A£®ÊäÈëËٶȿ죺Óë¼üÅÌÊäÈëÏà±È£¬ÌõÐÎÂëÊäÈëµÄËÙ¶ÈÊǼüÅÌÊäÈëµÄ5±¶£¬²¢ÇÒÄÜʵÏÖ“¼´Ê±Êý¾ÝÊäÈ딡£
¡¡¡¡B£®¿É¿¿ÐԸߣº¼üÅÌÊäÈëÊý¾Ý³ö´íÂÊΪÈý°Ù·ÖÖ®Ò»£¬ÀûÓùâѧ×Ö·ûʶ±ð¼¼Êõ³ö´íÂÊΪÍò·ÖÖ®Ò»£¬¶ø²ÉÓÃÌõÐÎÂë¼¼ÊõÎóÂëÂʵ ......
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
Response.Write(" <script>window.alrt('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡') </script>"); Response.Write(" <script>window.loation='http://www.cnblogs.com/kevin1031" target="_blank">http://www.cnblogs.com/kevin1031' </script>");
2.//µ¯³ö¶Ô»°¿ ......