Click here to Skip to main content
16,020,877 members

Comments by Member 10954869 (Top 9 by date)

Member 10954869 20-Aug-14 3:32am View    
i got inner exception is null why and what the problem
Member 10954869 14-Aug-14 7:10am View    
try this and give solution for me after browse the file in fileupload control that Upload Button is not showing
Member 10954869 14-Aug-14 7:09am View    
my aspx code
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.fileupload
{
margin: auto;
line-height: 50;
position: static;
width: 100px;
height: 100px;
}
.button
{
margin-top: 10px;
}
.btn
{
display: block;
}
</style>
<script type="text/javascript">
function ValidateUpload()
{
$(document).ready(
function(){
$('#FileUpLoad1').change(
function(){
if ($(this).val()) {
$('#btnUpLoad').attr('disabled',false);
}
}
);
});
}


// function ValidateUpload() {
// var uploadcontrol = document.getElementById('<%=FileUpLoad1.ClientID%>').value;
// if (uploadcontrol.length > 0) {
// document.getElementById("<%=btnUpLoad.ClientID%>" ).style.display = 0
// alert("uyffsd");

// }
// else {
// return false;
// }
// return true;

}
function uploadAlert() {
var uploadcontrol = document.getElementById('<%=FileUpLoad1.ClientID%>').value;
//Regular Expression for fileupload control.
var Extension = uploadcontrol.substring(uploadcontrol.lastIndexOf('.') + 1).toLowerCase();
if (uploadcontrol.length > 0) {
//Checks with the control value.
if (Extension == "txt" || Extension == "csv") {
alert("File Uploaded Succesfully");
return true;
}
else {
//If the condition not satisfied shows error message.
alert("Only .txt, .csv files are allowed!");
return false;
}
}
else {
alert("Please Select File");
}
}
</script>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upnlUserMgmt" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="btnUpLoad" />
</Triggers>
<contenttemplate>
<span>Create Bulk User</span>
<div align="center" class="fileupload">
<asp:FileUpload ID="FileUpLoad1" runat="server" ToolTip="Select a File" />
<div align="center">
<asp:Button ID="btnUpLoad" Text="UploadFile" OnClick="btnUpLoad_Click" OnClientClick="return uploadAlert();"
runat="server" Width="105px" CssClass="btn btn-info button" Visible="false"/>
<asp:RequiredFieldValidator ID="CustomValidator1" runat="server" ControlToValidate="FileUpLoad1"
ClientValidationFunction="return ValidateUpload();" ErrorMessage="Required File">

</div>
<asp:Label ID="lblresult" runat="server">
</div>


Member 10954869 14-Aug-14 7:08am View    
already done that modificatins not working
Member 10954869 14-Aug-14 6:22am View    
working there but not working oin asp.net