I'm new to this so apologies if it's an easy one:
I have a webpage with an iframe in it, the code in the iframe uploads a file to a folder.
Once the file is uploaded I want to refresh the parent page which list the uploaded files.
This is the code that fires to upload the file:
void Button1_Click(object Source, EventArgs e){
if (File1.Value == ""){
Span1.InnerHtml = "Error: you must enter a file name";
return;
}
if (File1.PostedFile != null){
try{
File1.PostedFile.SaveAs(Server.MapPath(Request.QueryString["fpath"]+"\\")+File1.Value);
Span1.InnerHtml = "File Uploaded";
}
catch (Exception exc){
Span1.InnerHtml = "Error saving file" + File1.Value + "" + exc.ToString();
}
}
}
I had hope I could just stick a window.parent.location.href = window.parent.location.href; in after saveas line