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.

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.