Disabling grid after reloading the page

Below is my code that is used to upload spread sheet using file uploader using this when i refreshes the page using reload this page in the browser i am able to upload the file multiple times but when i click on reload this page in the web page my grid should become disabled it is not getting disabled how can i do this

// Create a temporary file name to use for checking duplicates. string tempfileName = "";

// Check to see if a file already exists with the // same name as the file to upload. if (System.IO.File.Exists(pathToCheck)) { int counter = 2; while (System.IO.File.Exists(pathToCheck)) { // if a file with this name already exists, // prefix the filename with a number. tempfileName = counter.ToString() + fileName; pathToCheck = savePath + tempfileName; counter++; }

fileName = tempfileName;

// Notify the user that the file name was changed. //UploadStatusLabel.Text = "A file with the same name already exists." + // "<br />Your file was saved as " + fileName; } else { // Notify the user that the file was saved successfully. //UploadStatusLabel.Text = "Your file was uploaded successfully."; }

// Append the name of the file to upload to the path. savePath += fileName;