Änderungen Fileupload
This commit is contained in:
@@ -305,7 +305,7 @@
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<center>
|
||||
<asp:LinkButton ID="btn_Save_Changes" runat="server" BackColor="#043381" BorderStyle="None" CausesValidation="true" CssClass="btn btn-btn-primary" OnClick="btn_Save_Changes_Click"><label style="color:#fff" for="btn_Save_Changes">Save Changes</label></asp:LinkButton>
|
||||
<asp:LinkButton ID="btn_Save_Changes" runat="server" BackColor="#043381" BorderStyle="None" CausesValidation="true" CssClass="btn btn-btn-primary" OnClick="btn_Save_Changes_Click" OnClientClick="return ValidateFile_Desktop()"><label style="color:#fff" for="btn_Save_Changes">Save Changes</label></asp:LinkButton>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -386,9 +386,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
|
||||
|
||||
<td colspan="5">
|
||||
<div class="dropdown">
|
||||
<div class="dropdown show">
|
||||
<a class="btn btn-primary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="width:182.217px;background-color:#003680;color:#fff"><center><img id="myImage" src="<%=flagpath%>../images/Logo_small.png" style="border:1px solid #fff;width:102px; justify-items:center;color:#043381;background-color:#fff" alt="Logo Schriftzug: Verag Spedition AG Blaue Schrift: Verag Spedition Graue Schrift: AG" /></center></a>
|
||||
@@ -407,7 +405,7 @@
|
||||
<tr >
|
||||
<td colspan="5" style="height:35px">
|
||||
<center>
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" BackColor="#043381" BorderStyle="None" CausesValidation="true" CssClass="btn btn-btn-primary" OnClick="LinkButton1_Click"><label style="color:#fff" for="btn_Save_Changes">Save Changes</label></asp:LinkButton>
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" BackColor="#043381" BorderStyle="None" CausesValidation="true" CssClass="btn btn-btn-primary" OnClick="LinkButton1_Click" OnClientClick="return ValidateFile_Mobile()"><label style="color:#fff" for="btn_Save_Changes">Save Changes</label></asp:LinkButton>
|
||||
</center>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -433,5 +431,50 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js"></script>
|
||||
<script src="bootstrap-5.0.2-dist/js/bootstrap.min.js"></script>
|
||||
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var validFilesTypes = ["bmp", "gif", "png", "jpg", "jpeg", "doc", "xls"];
|
||||
function ValidateFile_Desktop() {
|
||||
var file = document.getElementById("<%=FileUpload_Desktop.ClientID%>");
|
||||
var label = document.getElementById("<%=FileUpload_Desktop.ClientID%>");
|
||||
var path = file.value;
|
||||
var ext = path.substring(path.lastIndexOf(".") + 1, path.length).toLowerCase();
|
||||
var isValidFile = false;
|
||||
for (var i = 0; i < validFilesTypes.length; i++) {
|
||||
if (ext == validFilesTypes[i]) {
|
||||
isValidFile = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isValidFile) {
|
||||
label.style.color = "red";
|
||||
label.innerHTML = "Invalid File. Please upload a File with" +
|
||||
" extension:\n\n" + validFilesTypes.join(", ");
|
||||
}
|
||||
return isValidFile;
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var validFilesTypes = ["bmp", "gif", "png", "jpg", "jpeg", "doc", "xls"];
|
||||
function ValidateFile_Mobile() {
|
||||
var file = document.getElementById("<%=FileUpload_Mobile.ClientID%>");
|
||||
var label = document.getElementById("<%=FileUpload_Mobile.ClientID%>");
|
||||
var path = file.value;
|
||||
var ext = path.substring(path.lastIndexOf(".") + 1, path.length).toLowerCase();
|
||||
var isValidFile = false;
|
||||
for (var i = 0; i < validFilesTypes.length; i++) {
|
||||
if (ext == validFilesTypes[i]) {
|
||||
isValidFile = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isValidFile) {
|
||||
label.style.color = "red";
|
||||
label.innerHTML = "Invalid File. Please upload a File with" +
|
||||
" extension:\n\n" + validFilesTypes.join(", ");
|
||||
}
|
||||
return isValidFile;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user