ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Disable Button based on file size using JavaScript in ASP.Net<p>&nbsp;</p> <pre class="brush: js">&lt;script type=&#34;text/javascript&#34;&gt; function validateFileSize() { var uploadControl = document.getElementById(&#39;&lt;%= FileUpload1.ClientID %&gt;&#39;); if (uploadControl.files[0].size &gt; 1048576) { alert(&#39;1&#39;); document.getElementById(&#39;dvMsg&#39;).style.display = &#34;block&#34;; document.getElementById(&#34;&lt;%=btnUpload.ClientID%&gt;&#34;).disabled = true; // document.getElementById(&#34;btnUpload&#34;).disabled = true; return false; } else { document.getElementById(&#39;dvMsg&#39;).style.display = &#34;none&#34;; document.getElementById(&#34;&lt;%=btnUpload.ClientID%&gt;&#34;).disabled = false; return true; } } &lt;/script&gt; </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/832579/Disable-Button-based-on-file-size-using-JavaScript-in-ASPNet/https://www.aspforums.net:443/Threads/832579/Disable-Button-based-on-file-size-using-JavaScript-in-ASPNet/Tue, 07 Aug 2018 23:40:33 GMT