Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NET MVC Uploading and Downloading Files


If you come to ASP.NET MVC from a purely ASP.NET Web Forms background, one of the first things you are likely to notice is that all those nice easy Server Controls have disappeared. One of those is the FileUpload, and its absence seems to cause a few problems. This article looks at how to upload files to the server in an MVC world, and how to get them back from the server to the user again.
 
In Web Forms, when you drag a FileUpload control on to the designer, something happens when the page is rendered which you probably don't notice. The resulting html form that wraps the entire page is decorated with an extra attribute: enctype="multipart/form-data". The FileUpload itself is rendered as an html input type=file. Within an MVC View, there are a number of ways to set this up. The first is with HTML:
<form action="/" method="post" enctype="multipart/form-data">
<input type="file" name="FileUpload1" /><br />
<input type="submit" name="Submit" id="Submit" value="Upload" />
</form>
Notice that the <form> tag includes the enctype attribute, and method attribute of post. This is needed because the form by default will be submitted via the HTTP get method.  The following approach, using the Html.BeginForm() extension method renders the exact same html when the page is requested:
<%
using (Html.BeginForm("", "home", FormMethod.Post, new {enctype="multipart/form-data"}))
{%>
<input type="file" name="FileUpload1" /><br />
<input type="submit" name="Submit" id="Submit" value="Upload" />
<% }%>
Notice the name attribute of the <input type="file"> element. We'll come back to that shortly. In the meantime, the resulting page should look rather blandly like this:
OK. So we can now browse to a local file and click the submit button to upload it to the web server. What is needed next is some way to manage the file on the server. W


Ïà¹ØÎĵµ£º

ASP.NET ʾÀý AJAX Ó¦ÓóÌÐò


      ±¾½Ì³Ì´´½¨Ê¹Óà ASP.NET µÄ AJAX ¹¦ÄܵĻù±¾Ê¾ÀýÓ¦ÓóÌÐò¡£Äú¿ÉÒÔÁ˽⵽ÓÐ¹Ø ASP.NET µÄ AJAX ¹¦Äܵĸü¶àÐÅÏ¢£¬½«ÖªµÀÕâЩ¹¦ÄÜÖ¼ÔÚ½â¾öÄÄЩ¼¼ÊõÎÊÌ⣬ÒÔ¼°ÒÔϽéÉÜÐÔÎĵµ½«Éæ¼°ÄÄÐ©ÖØÒªµÄ AJAX ×é¼þ£º
·ASP.NET AJAX Overview
·Ìí¼Ó AJAX ºÍ¿Í»§¶Ë¹¦ÄÜ
ÔÚ±¾½Ì³ÌÖУ¬Äú½« ......

Asp.Net ·¢ËÍ smptÓʼþ

using System.Web.Mail ;
private void Button1_Click(object sender, System.EventArgs e)
  {
 
   //ʵÀý»¯MailMessage¶ÔÏó
   System.Web.Mail.MailMessage mail=new System.Web.Mail.MailMessage();
 
   //¶¨ÒåÓʼþµÄ·¢Ë͵ØÖ· , ¿ÉÒÔËæ±ãÌîÒ»¸ö²»´æÔڵĵØÖ· ......

ÍÆ½é30±¾ASP.NETÊé

asp.net2.0ѧϰÀú³Ì ²ËÄñµ½Öм¶³ÌÐòÔ±µÄ·ÉÔ¾
2007-06-27 11:08:02 ±¾ÎÄÒѹ«²¼µ½²©¿ÍƵµÀÖ°³¡·´´Òµ·ÖÀà
Èç¹ûÄãÊÇÒ»¸ö²ËÄñ»òÕß×ÔÈÏΪ³õѧÕßÄÇô±¾Îķdz£ÊʺÏÄ㣻
²»ÄÜ˵Õâ30±¾Êé¾ÍÊÇ×î¼Ñ×éºÏ£¬µ«ÊÇ¿ÉÒÔ˵Õâ¸ö×éºÏ²»²î£»
±¾ÈËÔø²©ÀÀȺÊ飬ºÜ¶àÊéÖØ¸´£¬ºÜ¶àÊé½²µÄ²»ÊÊÓã¬ÕâЩÊé¶¼ÊÇĿǰÊéµê¿ÉÒÔÂòµ½µÄ£»
´ïµ½Öм ......

ASP.NETÃæÊÔ¾­Àú·ÖÏí

200XÄê12ÔÂ23ÈÕµÄÒ»´ÎÃæÊÔ¾­Àú£¨¹²ÁùÂÖ£©£¬ÖÁ´Ë9-XÖÜÄêÖ®¼Ê£¬ºÍ¸÷λÅóÓÑ·ÖÏí£¬Ï£Íû¶Ô¸÷λÅóÓÑÓÐÓã¬ÓÐЩ×Ô¼ºµÄ´ð°¸Ìù³öÀ´Ò²½ö½öÊÇÅ×שÒýÓñ£¬Ï£Íû¸÷λÅóÓѲ»Áߴͽ̣¬Ëµ¾äÀÏʵ»°£¬ÃæÊÔµÄʱºòʱ¼äºÜ½ô£¬ºÜÄÑ¿¼ÂÇ×îÓÅËã·¨¡£
ÆðÒòÊÇÅóÓÑÍÆ¼öÎÒÈ¥W¹«Ë¾Ó¦Æ¸Senior SDEÕâ¸öְλ£¬Ó¦¸ÃËãÊÇÄÚ²¿ÍƼöÁË£¬ÏÂÃæÊÇÕÐÆ¸ÒªÇó
Title: Senio ......

FCKeditor ÔÚASP.Net ÖеÄʹÓÃ˵Ã÷


FCKeditor ÔÚASP.Net ÖеÄʹÓÃ˵Ã÷
[ 2008-7-23 23:41:00 | By: »ª×Ó ]
 
2
ÍÆ¼ö
 
FCKeditor ÊÇÒ»¸öÔËÐÐÔÚä¯ÀÀÆ÷É쵀 Java Ó¦ÓóÌÐò¡£Ëû¿ÉÒÔ²»ÒÀÀµÈκηþÎñÆ÷¶ËÓïÑÔÔËÐС£²»¹ý£¬¸üºÃµÄʹÓ÷½·¨ÊÇÄãʹÓÃÒ»ÖÖ·þÎñÆ÷¶ËÓïÑÔÀ´µ÷ÓÃËû¡£
ÔÚASP.Net ÖУ¬ÓÐÒ»¸öÏֳɵŤ¾ß°ü¿ÉÒÔÈÃÄã°Ñ FCKeditor ×÷Î ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ