MVC到底比webform 好在那?不說那些有的沒的
我們的項目還停留在mvc
這是一個函數 調用方式
protected ActionResult BaseUploadFile(int Maxlength
{
try
{
HttpPostedFileBase [
string[] str = (
string extion = str[str
bool isExtion = false;
foreach (string pos in postfix)
{
if (pos == extion)
{
isExtion = true; break;
}
}
if (string
{
return Content(
}
string saveUrl =
if ( > Maxlength)
{
return Content(
}
(Server
return Content(saveUrl)
}
catch (Exception ex)
{
return Content(
}
}
前台代碼 此處要用到一個jquery 的插件 Form
看看就是這個效果
View Code
<script type=
function showResponse(responseText
if (responseText ==
alert(
}
if (responseText ==
alert(
}
if (responseText ==
alert(
}
$(
}
function sumbitFile() {
var options = {
success: showResponse
}
$(
}
</script>
<form action=
<img src=
</form>
<div id=
From:http://tw.wingwit.com/Article/program/net/201311/12286.html