JS代码:

<script type="text/javascript">
$(document).ready(function ()
{
$("#<%= masterFileUpload.ClientID %>").change(function ()
{
if ($("#<%= masterFileUpload.ClientID %>").val() != "")
{
$("#<%=txtMasterFilePwd.ClientID%>").removeAttr("disabled", "disabled");
}
else
{
$("#<%=txtMasterFilePwd.ClientID%>").val("");
$("#<%=txtMasterFilePwd.ClientID%>").attr("disabled", "disabled");
}
}); });
</script>

HTML代码:

  <tr>
<td style="text-align: right" class="auto-style1">**文件名:</td>
<td class="auto-style2">
<asp:FileUpload ID="masterFileUpload" runat="server" ClientIDMode="Static" Width="350" />
</td>
<td class="auto-style2">
<asp:Label ID="lbmasterFileUpload" runat="server" ClientIDMode="Static"></asp:Label>
</td>
</tr>
<tr>
<td style="text-align: right" class="auto-style1">**密码:</td>
<td class="auto-style2">
<asp:TextBox ID="txtMasterFilePwd" runat="server" CssClass="txt_search" ClientIDMode="Static" Width="200px" onkeydown="if(event.keyCode==222){return false;}" ></asp:TextBox>
</td>
</tr>

说明: <asp:TextBox ID="txtMasterFilePwd"。。。。>是服务器控件,但是在JS中设置它的属性时,一定要用编译后生成的对应HTML控件的属性才好用。

最新文章

  1. from collections import OrderedDict
  2. 孙鑫MFC学习笔记2:C++回顾
  3. js控制精度的加减乘除:js浮点数计算问题
  4. c/c++细节知识整理
  5. SQLServer找出执行慢的SQL语句
  6. mysql查找字符串出现位置
  7. ruby(html)
  8. 【转】Linux中安装Resin
  9. css两列布局,一边固定宽度,另一边自适应
  10. Linq技术四:动态Linq技术 -- Linq.Expressions
  11. wenpack-simple+elementUI配置
  12. oracle数据库--序列(sequence)
  13. Bootstrap3 表格-带边框的表格
  14. vuex 收藏一个循序渐进,易懂易行的博客。
  15. mysql 开发基础系列2 整型数据类型
  16. 用例该如何书写?完整示例-QQ登录界面
  17. Android四大组件之---activity生命周期详解
  18. PDCA 价值所在
  19. Spring Boot 连接池
  20. 使用SplashScreenManager控件定制程序加载页面

热门文章

  1. net start sql server (instance)
  2. Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Cannot open connection
  3. Eclipse中插件的使用:maven /ant /tomcat
  4. Entity Framework Code-First(9.4):DataAnnotations - Required Attribute
  5. SCSS 中的 &amp;::before 和 &amp;::after
  6. Page_Load事件与IsPostBack属性
  7. BKMyFAQ
  8. elasticsearch shard 和 replica
  9. 水库(树形dp)
  10. bzoj 4974: [Lydsy八月月赛]字符串大师