日期:2014-05-17 浏览次数:20403 次
<uc1:AttachmentMore ID="AttachmentMore1" runat="server" />
AttachmentMore1.PersonId = CurrentUserInfo.PersonID;
AttachmentMore1.ModuleCode = BLL.ModuleCode.工作日志;
public ActionResult More(int menuid)
{
var AchmentSet = GetAttachmentSet(menuid);
ViewBag.MaxSize = 10240;//限制附件上传的大小 默认10M
ViewBag.LimitType = "";//限制附件上传的类型
if (AchmentSet != null)
{
ViewBag.MaxSize = AchmentSet.MaxSize;
ViewBag.LimitType = AchmentSet.NotAllowFileType;
}
return PartialView();
}
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<script type="text/javascript" language="javascript">
/*
ShowAddFile('<%= this.ClientID%>');
ShowAddImage('<%= this.ClientID%>');
if (typeof (upload_limit) == "undefined") {
upload_limit = 1;
}
if (typeof (attachMaxLength) == "undefined") {
attachMaxLength = "@ViewBag.MaxSize";
}
if (typeof (limit_type) == "undefined") {
limit_type = "@ViewBag.LimitType";
}*/
$(function () {
alert("@ViewBag.MaxSize");
});
</script>
$("#层id").lo