Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

my .net 4 framework visual stdio 2010
my os = winodws 7

i retain fileupload value in viewstate and get value in the label in the page load .

then retrieve in every clicked button.

it is working fine in my pc and even in the iis7



but when i deployed in the client machine

os = windows server 2008 r2 and iis 7

but client iis7 when i uploading file then file name is not set in the label

what was the problem i am not getting

plz help me
Posted
Comments
ZurdoDev 20-Feb-15 12:13pm    
There is no way we can know the problem without seeing your code and what you did. Click Improve question and give us some more info.

However, the most common problem when it works in dev and not in production is a security issue. Make sure your app pool's identity account has the proper permissions.
sadhana4 20-Feb-15 12:43pm    
page load:
if (ViewState["attachemnet1"] == null && flupEmailAttachment.HasFile)
{
ViewState["attachemnet1"] = flupEmailAttachment.FileName;
lblAttachemnt1.Text = flupEmailAttachment.FileName;
}
// Next time submit and Session has values but FileUpload is Blank
// Return the values from session to FileUpload
else if (ViewState["attachemnet1"] != null && (!flupEmailAttachment.HasFile))
{
lblAttachemnt1.Text = ViewState["attachemnet1"].ToString();
}
// Now there could be another sictution when Session has File but user want to change the file
// In this case we have to change the file in session object
else if (flupEmailAttachment.HasFile)
{
ViewState["attachemnet1"] = flupEmailAttachment.FileName;
lblAttachemnt1.Text = flupEmailAttachment.FileName;
}


button click

protected void btnSendEmail_Click(object sender, EventArgs e)
{

if (ViewState["attachemnet1"] != null)
{

lblAttachemnt1.Text = ViewState["attachemnet1"].ToString();


}


javascripts design page:
<script type="text/javascript">
window.pressed = function () {
var a = document.getElementById('flupEmailAttachment')
if (a.value == "") {

lblAttachemnt1.innerHTML = "Choose file";

}
else {

var theSplit = a.value.split('\\');
lblAttachemnt1.innerHTML = theSplit[theSplit.length - 1];
}

}
</script>


<asp:Label Id="lblAttachemnt1" runat="server"><asp:FileUpload ID="flupEmailAttachment" onchange="pressed()" style="color: transparent" runat="server" /><input type="button"
title="+" runat="server" id="btnAddMoreAttachment_1" value="+" />


}
sadhana4 20-Feb-15 12:46pm    
i have 3 model popup for showing message box but i am saving in the viewstate
then why i unable to save in the label and in the label file name is not displaying name

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900