When i upload a file to my server i have the codebehind check for several illegal situations, and then i set the text of an asp:label to display the error if one occurs.
The problem is that the file upload posts back even when the if statement fails and an error is written to the label, thus resetting the page to its original state and resetting the message label.
Edit and Update After accepting that the postback would occur i loaded the error messages into a session variable and on post back checked that variable for an error rand updated the asp:list to show the error message.
The line that updated the asp:label had to be placed into a PreRender event as the Load event happened before the postback had processed. causing the page to have to postback twice to show the message.
U hope this helps anyone. Additionally as mentioned below reading through the ASP Page Life Cycle will do wonders