In my aspx page, I have two buttons -
1. Upload - (uplOfficePdf_FileUploadComplete)
- call uplOfficePdf.UploadFile()
- Show uploaded file name in label and
- save uploaded file details in page Viewstate
2. Save - (btnSave_Click)
- Fetch Uploaded file detail from Viewstate and Save
But when I run the app, neither label text is updated nor ViewState is maintained.
Could you please guide a solution for above issue.
I have attached a demo project for your ref.
ASPxUploadControl does not refresh a page when you upload a file. The control returns a JSON string back to the client side when you upload a file using the e.CallbackData property in the ASPxUploadControl.FileUploadComplete event handler.
On the client side, the control raises an event with the same name, and callback data can be read using the e.callbackData property.
All these manipulations are not stored in ViewState.
If you want to change the label's Text, you should wait till the client-side event is raised, and then call the ASPxClientLabel.SetText method.
Thank you for your response. As an immediate solution, you can try to upload a file and save all required information to a Session variable. This way, you will be able to extract this information later (i.e. when you press the Save button).
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.