asp.netÖ§³Ö´óÎļþÉÏ´« NeatUpload
1.ÔÚ¹¤¾ßÏäÖÐÌí¼ÓBrettle.Web.NeatUpload.dll£¬¿ÉÒÔ¿´µ½¹¤¾ßÏäÖгöÏÖInputFileµÈ¿Ø¼þ¡£
2.¸´ÖÆÎļþ¼ÐNeatUploadµ½¸ùĿ¼.
3.ÍÏ·ÅʹÓÃÉÏ´«¿Ø¼þInputFileºÍ½ø¶ÈÌõProgressBar,Ìí¼ÓÉÏ´«ÎļþµÄ°´Å¥.aspxÒ³Ãæ´úÂëÈçÏ£º
<body>
<form id="form1" runat="server">
<div>
<upload:InputFile id="AttachFile" runat="server"></upload:InputFile>
<asp:Button ID="Upload" runat="server" Text="Upload"
OnClientClick="ToggleVisibility('ProgressBar','on')"
OnClick="Upload_Click"/>
<div id="ProgressBar" style="display:none;">
<upload:progressbar id="pbProgressBar" runat="server" Inline="true"
Width="500px" Height="100"> </upload:progressbar>
</div>
</div>
</form>
</body>
4.Ìí¼Ó½Å±¾´úÂëToggleVisiblityº¯Êýµ½Ò³ÃæÉÏÈçÏ£º
<script type="text/javascript" language="javascript">
function ToggleVisibility(id, type)
{
el = document.getElementById(id);
if(el.style)
{
if(type == 'on')
{
el.style.display = 'block';
}
else
{
el.style.display = 'none';
}
}
else
{
if(type == 'on')
{
el.display = 'block';
}
else
{
el.display = 'none';
}
}
}
</script>
5.¸øÉÏ´«ÎļþµÄ°´Å¥Ìí¼ÓʼþUpload_Click
protected void Upload_Click(object sender, EventArgs e)
{
string FileName = this.AttachFile.FileName;//»ñÈ¡ÉÏ´«ÎļþµÄȫ·¾¶
string ExtenName = System.IO.Path.GetExtension(FileName);//»ñÈ¡À©Õ¹Ãû
string SaveFileName =
System.IO.Path.Combine(Request.PhysicalApplicationPath,
DateTime.Now.ToString("yyyyMMddhhmm") + ExtenName);//ºÏ²¢Á½¸ö·¾¶ÎªÉÏ´«µ½·þÎñÆ÷ÉϵÄȫ·¾¶
if (this.AttachFile.ContentLength > 0)
{
try
{
this.AttachFile.MoveTo(SaveFileName, Brettle.Web.NeatUpload.MoveToOptions.Overwrite);
}
catch (Exception ex)
{
throw ex;
}
}
}
6.ÔÚÅäÖÃÎļþweb.configÖÐÌí¼ÓhttpÄ£¿éÉùÃ÷:
<ht
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
1.using gizp compress page ,gif file can't be compressed.
2.put script at the bottom,and put css at the top.
3.make the css and js external.
4.load-on-demand.(If a UI block need to show by control.Set visibable=false. and enableviewstate=true,override the saveviewstate method.)
5.remove the dupl ......
ÔÚ×î½üµÄÏîÄ¿ÖУ¬Óöµ½Ò»¸öÎÊÌ⣬ҪʵÏÖÕâÑùµÄЧ¹û£º
µãpic_small.AspxÒ³ÃæµÄËõÂÔͼºóµ¯³öpic_all.aspxÒ³Ã棬pic_all.aspxÒ³ÃæµÄ´óСҪ¸ù¾ÝͼƬ´óС×Ô¶¯µ÷Õû£¬¶øÇÒÒªÓÐͼƬµÄ˵Ã÷ÐÅÏ¢£¬»¹¿ÉÒÔµãÉÏÒ»·ùºÍÏÂÒ»·ùµÈ½øÐзҳ¡£
ʵÏÖ¹ý³ÌÈçÏ£º
pic_small.AspxÒ³ÃæËõÂÔͼ´¦µÄ´úÂëΪ£º
£¼IMG id="imgPic" style="CURSOR: h ......
´«Í³ÐÍASP.NET Web FormsÊÇ»ùÓÚͬʱ°üº¬Á˱íÏÖ²ãºÍºǫ́´úÂëµÄWebÒ³Ã棬ËùÒÔ£¬½ôËæÆäºó³öÏÖµÄASP.NET AJAX£¬ÌرðÊÇÕâ¸ö¿ò¼ÜµÄ·þÎñÆ÷¶Ë¿Ø¼þ²¢Ã»ÓÐÏñËüÃDZ¾Ó¦¸ÃµÄÄÇÑù¹ââËÄÉä¡£ÓÚÊÇ£¬ºÜ¶à¸úËæAJAXʱ÷ÖµÄASP.NET¿ª·¢ÕßÖ»ÊÇÏòASP.NETÒ³ÃæÖÐËæÒâµØ·ÅÖÃһЩUpdatePanel¿Ø¼þÒÔ±ãʹÆä³ÌÐòʵÏÖ»ù±¾µÄAJAXÖ§³Ö¡£Êµ¼Ê ......
1ʲôÊÇͼƬµÁÁ´
ÈÃÎÒÃÇÏÈ·ÖÎöÒ»°ãµÄä¯ÀÀÏÖÏó£¬ÆäÖÐ×îÖØÒªµÄÒ»µã¾ÍÊÇÒ»¸öÍêÕûµÄÒ³Ãæ²¢²»ÊÇÒ»´ÎÈ«²¿´«Ë͵½¿Í»§¶ËµÄ£®Èç¹ûÄãÇëÇóµÄÊÇÒ»¸ö´øÓÐÐí¶àͼƬºÍÆäËüÐÅÏ¢µÄÒ³Ã棬ÄÇô×îÏȵÄÒ»¸öHttpÇëÇó±»´«ËÍ»ØÀ´µÄÊÇÕâ¸öÒ³ÃæµÄÎı¾£¬È»ºóͨ¹ý¿Í»§¶ËµÄä¯ÀÀÆ÷¶ÔÕâ¶ÎÎı¾µÄ½âÊÍÖ´ÐУ¬·¢ÏÖÆäÖл¹ÓÐͼƬ£¬ÄÇô¿Í»§¶ËµÄä¯À ......