I have the following code where I set the uploadDirectory path for a file upload. Every time the application posts back, the variable loses its value. Why? Shouldn't the value be retained?
I figured I'd add the if(!IsPostBack) clause in there so it wouldn't continously calculate the uploadDirectory repeatidly over again. But that apparently loses the value after the initial postback. public partial class Files_UploadFiles_Sample1 : System.Web.UI.Page
{
private string uploadDirectory; -Value is lost everytime a postback occurs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
uploadDirectory = Path.Combine(
Request.PhysicalApplicationPath, Go to the complete details ...