http://developer.51cto.com/art/200907/140267.htm
- Oct 22 Wed 2014 15:17
ASP.NET中Get和Post的用法
- Oct 17 Fri 2014 15:59
SQL DB測試機異動至正式機
一、先用Vistual Studio Utimate的SQL Schema比對測試機DB和正式機DB差異。
二、與PM討論是否需要停機
- Oct 06 Mon 2014 13:50
Auto logout and redirect to login page when session expires
- Oct 03 Fri 2014 09:42
jQuery 處理上傳相同檔案事件不觸發狀況
- Oct 02 Thu 2014 15:58
jQuery & InputFile 驗證檔案單個尺寸
<input type="file" name="FileUpload1" id="FileUpload1" class="form-control" style="width:400px;" runat="server" /> <img id="testImg" src="#" alt="your image" /> <script> $(function () { $('#testImg').hide(); }); function getImgSize(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#testImg').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $('#testImg').on('load', function () { if (($(this).width() == 77) && ($(this).height() == 50)) { } else { $('#<%=FileUpload1.ClientID%>').val(''); alert('※上傳檔案尺寸不符規定※'); } }) $('#<%=FileUpload1.ClientID%>').change(function () { getImgSize(this); }); </script>
- Oct 02 Thu 2014 15:57
jQuery & InputFile 驗證檔案尺寸
<img id="testImg1" src="#" alt="your image" /> <img id="testImg2" src="#" alt="your image" /> <script> $(function () { $('#testImg1').hide(); $('#testImg2').hide(); }); function getImgSize(input, id) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#testImg' + id).attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } $('#testImg1').on('load', function () { if (($(this).width() == 77) && ($(this).height() == 50)) { } else { $('#<%=FileUpload1.ClientID%>').val(''); alert('※上傳檔案尺寸不符規定1※'); } }) $('#testImg2').on('load', function () { if (($(this).width() == 77) && ($(this).height() == 50)) { } else { $('#<%=FileUpload2.ClientID%>').val(''); alert('※上傳檔案尺寸不符規定2※'); } }) $('#<%=FileUpload1.ClientID%>').change(function () { getImgSize(this, 1); }); $('#<%=FileUpload2.ClientID%>').change(function () { getImgSize(this, 2); }); </script>
- Oct 02 Thu 2014 15:55
jQuery & InputFile 驗證檔案單個、多個大小
<input type="file" multiple="multiple" name="File1[]" id="File1" accept="image/*" class="yellowButton_fileupload" style="width:200px;" /> <script> $(document).ready(function () { $('#<%=按鈕_上傳.ClientID%>').hide(); }); $('input#File1').change(function () { var files = $(this)[0].files; var size = 0; var check = 0; for (var i = 0; i < files.length; i++) { size = size + this.files[i].size; if (this.files[i].size > 1024 * 1024) { alert('單個檔案大小大於1MB,不允上傳'); $('input#File1').val(''); check = 1; break; } } if (check == 0) { if (size > 1024 * 1024 * 10) { //alert(size); alert('您選擇上傳的檔案大小大於10MB,請重新選擇!'); $('input#File1').val(''); $('#<%=按鈕_上傳.ClientID%>').hide(); } else { //alert('ok'); $('#<%=按鈕_上傳.ClientID%>').show(); } } }); </script>
- Oct 02 Thu 2014 10:26
jQuery取得FileUpload圖片大小
function getImgSize(input) {
if (input.files && input.files[0]) {
- Sep 30 Tue 2014 12:23
讓Chrome瀏覽器支援MaintainScrollPositionOnPostback屬性
http://tgw1029.blogspot.tw/2010/05/chromemaintainscrollpositiononpostback.html
- Sep 30 Tue 2014 11:06
jQuery 判別上傳檔案個數及檔案大小
<input type="file" multiple="multiple" name="File1[]" id="File1" accept="image/*" class="yellowButton_fileupload" style="width:200px;" /> <script> $('input#File1').change(function () { var files = $(this)[0].files; //alert(files.length); var size = 0; for (var i = 0; i < files.length; i++) { size = size + this.files[i].size; } if (size > 1024 * 1024 * 10) { //alert(size); alert('您選擇上傳的檔案大小大於10MB,請重新選擇!'); $('#<%=按鈕_上傳.ClientID%>').hide(); } else { //alert('ok'); $('#<%=按鈕_上傳.ClientID%>').show(); } }); </script>