I am using file upload with post back trigger but when I attach file first time it is not accept unless attached again in the second time. In addition, without post back trigger it woks but uploading the whole page that why I tried to use trigger because without it the upload button stopped
Please help
- protected void Upload(object sender, EventArgs e)
- {
- if (FileUpload1.HasFile && ddlSelect.Text == "Document")
- {
- Code for Uploading file code
- .
- .
- .
- }
- else
- if (FileUpload2.HasFile && ddlSelect.Text == "Video")
- {
- Code for Uploading video file
- .
- .
- .
- }
- else
-
-
- if(FileUpload1.HasFile && FileUpload2.HasFile && ddlSelect.Text == "Both")
- .
- .
- .
- .
-
- {
-
-
- }
-
- asp code for trigger
-
- </ContentTemplate>
- <Triggers>
- <asp:PostBackTrigger ControlID="btnUpload" />
- </Triggers>
- </asp:UpdatePanel>