<style type="text/css">
html, body {
margin: 0;
padding: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.noClick{
pointer-events: none;
}
</style>
<script type="text/javascript">
//div禁用,不可点击;div禁用——添加样式style={pointer-events: none;}
function noClick() {
$("#divFile").addClass("noClick"); //方法1
//$("#dgFile").addClass("noClick"); //方法2
};
</script>
<table width="100%">
<tr>
<td align="left" style="padding-left:20px">
<div id="divFile" style="height:80px;">
<cc1:MiniDataGrid ID="dgFile" runat="server" Height="100%" Width="100%" AllowCellEdit="true" ShowPager="false" ShowExportBottons="false" OnDataBinding="dgFile_DataBinding">
<Columns>
<cc1:TableItemColumn Field="FileName" Name="FileName" Text="文件名称" HeaderAlign="center" IsFitColumn="true" />
<cc1:TableItemColumn Field="RiskFilesAccessory" Name="RiskFilesAccessory" DisplayField="FileCount" Text="上传支撑文件" HeaderAlign="center" Align="center" RenderType="Accessory" Width="200" />
</Columns>
</cc1:MiniDataGrid>
</div>
</td>
</tr>
</table>
this.JSCallMethod("noClick", ScriptUtil.ToScriptString("TRUE")); //div禁用,上传控件禁用
this.JSCallMethod("noClick", ScriptUtil.ToScriptString("FALSE")); //div禁用,上传控件禁用
//div禁用,不可点击;div禁用——添加样式style={pointer-events: none;}
function noClick(result) {
if (result == "TRUE") {
$("#divFile").addClass("noClick"); //添加禁用样式
//$("#tips").show();
}
else {
$("#divFile").removeClass("noClick"); //删除禁用样式
//$("#tips").hide();
}
};
<tr style="text-align: center; color: red;">
<td colspan="2">
<span id="tips" style="color:red;">*请先点击保存按钮后,再上传文件(建议上传图片大小:900px X 350px),图片大小不超过1MB</span>
</td>
</tr>
<tr>
<td colspan="2" id="divFile">
<cc1:Uploadify runat="server" ID="upload" PanelHeight="150" ShowMode="编辑模式" Vertical="false"
ButtonText="上传项目图册" ButtonClass="button" ProgressData="speed" ButtonCursor="hand"
FileTypeExts="*.bmp;*.jpg;*.jpeg;*.gif;*.png" FileSizeLimit="1MB" RemoveCompleted="false"
FileTypeDesc="文件说明" MultiSelect="true" PanelWidth="680" />
</td>
</tr>