javascriptÓëasp.netʵÏÖÎļþÉÏ´«
·½·¨Ò»£ºÊ¹ÓÃFileUpLoad ¿Ø¼þ¶à¸öÖ±½ÓÉÏ´«¡£ÕâÑù×öµÄÎÊÌâ¾ÍÊÇÒªÇóÒ³ÃæÌá½»£¬´Ó¶øµ¼ÖÂһЩ²»Ó¦¸ÃˢеÄÄÚÈÝÔڴ˲Ù×÷¹ý³ÌÖÐÏûʧµô¡£µ«ÊÇÓÃScriptManger À´Åª È´ÓÖ²»ÄÜÉÏ´«ÁË ÔÒòºÜ¼òµ¥ FileUpLoad ¿Ø¼þÒªÇópost¡£ÓÉÓÚÕâ¸öÎÊÌâ ËùÒÔ¶àÊýÈ˶¼ºÜÉÙ²ÉÓÃÕâÖÖ·½·¨£¬²»µÃ²»ÁíÑ°Ëü·¨¡£ÏÂÃæµÄ·½·¨¶þ½â¾ö´ËÎÊÌâ¡£
·½·¨¶þ£ºÊ¹ÓÃHtml±êÇ©<input type="file"/> + form µÄsubmitÀ´ÊµÏÖ¡£ÎÒÃÇÒ»±ßʵÏÖÎļþÉÏ´«¶¼»á¶ÔÎļþÓÐЩ˵Ã÷£¬Îļþ·ÅÔÚ·þÎñÆ÷Ó²ÅÌÉÏ£¬µ«ÐÅϢȷÊÇ·ÅÔÚÊý¾Ý¿âÖУ¬ËùÒÔÕâÖÖ·½·¨ ¾Í»áµ¼ÖÂÕâÁ½²¿·ÖÐÅÏ¢µÄ´æ´¢ÎÊÌâ¡£²»¹ýÕâÖÖ·½·¨×ÜÊDZȷ½·¨Ò»¿ÉÈ¡£¬ÎÒÃÇ¿ÉÔÚ½²¶àÎļþµÄÐÅÏ¢Ò»Ò»Ìá½» Ò»Ò»±£´æ¡£¶ÔÓÚÔÚ×îºóÌá½»ÎļþÆäËûÐÅÏ¢µÄʱºò²ÅÌá½»Îļþ ÕâÑù¼õÉÙÁ˶ÔÎļþ¿ØÖÆ£¨Èç¹ûÏÈÌá½»Îļþ£¬µ«×îºóÓû§²¢Ã»ÓÐÑ¡ÔñÌá½»ÎļþµÄÆäËûµÄÐÅÏ¢£¬ÕâÊÇÓÉÐèÒªÉÏ´«ÉÏ´«µÄÎļþ£¬ÕâÑù¾Í´øÁ˺ܶàÆäËûµÄÎÊÌ⣬¶øÇÒ²Ù×÷Ò²²»·ûºÏÓû§²Ù×÷£©¡£ËùÒÔ¶¼ÏëÏȽ«ÒªÉÏ´«µÄÎļþÑ¡ÔñºÃµ½×îºóµÄʱºòÒ»ÆðµÄÌá½»£¬Èç¹û×îÖÕÓû§Ã»ÓÐÌá½»£¬ÄÇÒ²²»ÓÃÔÙ½øÐÐÎļþ´Ó·þÎñÆ÷ÉÏɾ³ýµÄÄÇÒ»²½²Ù×÷ÁË£¬ÕâÑù¼õÉÙÁ˺ܶà²Ù×÷ºÍÆäËûÎÊÌ⣬ҲÊÇÎÒÕýÏëÒªµÄЧ¹û¡£
·½·¨Èý£º¾ÍÊÇʹÓÃjs +Ajax À´ÊµÏÖ£¬²âÊÔ¹ýºÃÏñ²»ÐУ¬ÒòΪÎÒÃÇÉÏ´«ÎļþµÄʱºòÐèÒªÉèÖÃenctype="multipart/form-data"£¬ÕâÑù²âÊÔ¹ýµ¼ÖÂÎļþµÄÆäËûÐÅÏ¢Õ¦·þÎñÆ÷¶Ë»ñÈ¡²»µ½£¬²âÊÔ¹ýÒ»´ÎÒ²²»ÖªµÀÊÇ×Ô¼ºÅª´íû¡£
·½·¨ËÄ£ºÔÚ·½·¨¶þµÄÑÓÉ죬Èç¹û×Ô¼ºµÄÉÏ´«Êǵ¥¶À·Ö¿ªµÄ¡£¿ÉÒÔʹÓÃflexµÄÉÏ´«£¬Íâ¹Û±È½ÏºÃ¡£
ͬʱÓë·½·¨¶þ¿ÉÒÔµ÷ÓÃͬһºǫ́ÉÏ´«Îļþ´¦Àí³ÌÐò¡£
·½·¨¶þµÄÀý×ÓÈçÏ£º
ʹÓÃÁËprototype.js¼Ü¹¹
js ²¿·Ö
var Bind = function(object, fun) {
return function() {
return fun.apply(object, arguments);
}
}
var Each = function(list, fun){
for (var i = 0, len = list.length; i < len; i++) { fun(list[i], i); }
};
var Extend = function(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
}
var FileUpload=Class.create();
FileUpload.prototype={
initialize:function(folder,hiddenId,options){
this.Folder=document.getElementById(folder)? document.getElementById(folder):document.body;
th
Ïà¹ØÎĵµ£º
ÒÔÏÂÒÔ IE ´úÌæ Internet Explorer£¬ÒÔ MF ´úÌæ Mozzila Firefox
1. document.form.item ÎÊÌâ
(1)ÏÖÓÐÎÊÌ⣺
ÏÖÓдúÂëÖдæÔÚÐí¶à document.formName.item("itemName") ÕâÑùµÄÓï¾ä£¬²»ÄÜÔÚ MF ÏÂÔËÐÐ
(2)½â¾ö·½·¨£º
¸ÄÓà document.formName.elements["elementName"]
(3)ÆäËü
²Î¼û 2
2. ¼¯ºÏÀà¶ÔÏóÎÊÌâ
(1)ÏÖÓÐÎÊÌ⣠......
html֪ʶ£¬Request.Form
½ÓÊÕµÄÊÇNameÖµ£¬¶ø·ÇIDÖµ
ÈôÊÇÓÃaspxÒ³ÃæÈ¡Öµ£¬±íµ¥ÖеÄrunat="server"Ҫȥµô¡£
asp.net֪ʶ£¬asp.netµÄ¿Ø¼þµÄIDºÍNameÖµÊÇÒ»ÑùµÚ£¬µ«ÊÇÆäÔÚ¿Í»§¶Ë±íÏÖÊÇcontrol.clientID¶ø·Ç
control.ID
asp.net±¾ÉíÒ²ÊÇ¿ÉÒÔ¿çÒ³Ìá½»µÎ£¬Èç¹ûÊÇʹÓÃ×Ô¼º´øµÄ¿çÒ³Ìá½»¾Í²»´æÔÚÉÏÊöÎÊÌ⣬²»¹ýas ......
<script language="JavaScript">
<!--
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year< 100) year = 1900 + year;
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = ......
ÏÈÉý¼¶ieµ½5.5°æÒÔÉÏ
1 ÏÂÔØÖÐÎÄ°æIE6:http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/ie6setup.exe
2 ÏÂÔØmdac°²×° Ö±½ÓÏÂÔØ2.8ÖÐÎÄ°æ:http://download.microsoft.com/download/8/b/6/8b6198c0-fe96-4811-9d81-d5c76dd5fea8/MDAC_TYP.EXE
3 È»ºóÏÂÔØ.NET Framework 1.1°æ¿ÉÔÙ· ......