1

I have project where I need to dynamically update the Table control based on a button_click event.

Every time the Button is clicked, the Table resets itself based on different inputs. The inputs come from a file which is uploaded by the client.(I did this with the file Uploader control). The client can essentially upload a different file every time and click the Button to reset the Table based on the inputs from the file.

try
{    
    Upload1003.PostedFile.SaveAs(@"path" + filename);
    parseAnswer = parse.parse(@"path", filename);
    Span1.InnerHtml = "File Upload Sucessful";     
}

catch (Exception)
{
    Span1.InnerHtml = "File Upload Error";
};

int col = 3;
int row = parseAnswer.getTotalItem();
Create1003Table(col, row, parseAnswer);

The Table only works on first click. The second clicks gives me an error:

Operation is not valid due to the current state of the object

I just started learning C# and ASP.Net. So I am not sure about what is causing this error.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • related to this issue? http://stackoverflow.com/questions/8978929/asp-error-operation-is-not-valid-due-to-the-current-state-of-the-object – Goose Jul 17 '12 at 20:21

0 Answers0