display some hidden label after file upload

T

Tony WONG

i tried to show hidden label and hidden button after successful upload. it
fails

but i tried to put to UNsuccessful upload, it works.

Could i have your advice? Thanks a lot.

************************************
Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles
FormView1.ItemUpdating
If postedFile.HasFile Then
If postedFile.PostedFile.ContentLength <= 2097152 Then
postedFile.SaveAs("e:\" + Request.QueryString("year") + "\"
+ myFileName.Text)
FormView1.FindControl("LabelOversize3").Visible = True
FormView1.FindControl("UploadButton").Visible = False
Else
e.Cancel = True
FormView1.FindControl("LabelOversize2").Visible = True
End If
End If
End Sub
 
C

Cowboy \(Gregory A. Beamer\)

Tony WONG said:
i tried to show hidden label and hidden button after successful upload.
it fails

but i tried to put to UNsuccessful upload, it works.

Could i have your advice? Thanks a lot.

************************************
Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles
FormView1.ItemUpdating
If postedFile.HasFile Then
If postedFile.PostedFile.ContentLength <= 2097152 Then
postedFile.SaveAs("e:\" + Request.QueryString("year") + "\"
+ myFileName.Text)
FormView1.FindControl("LabelOversize3").Visible = True
FormView1.FindControl("UploadButton").Visible = False
Else
e.Cancel = True
FormView1.FindControl("LabelOversize2").Visible = True
End If
End If
End Sub


is this AJAX? If so, you will not be able to update controls on the client
side using server side script in this manner.
 
T

Tony WONG

Thanks it is ok now.

the label and button were embedded in edit template cause this error
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top