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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

********************************************************
| Think outside the box! |
********************************************************
 
T

Tony WONG

Thanks it is ok now.

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

Gregory A. Beamer

Thanks Gregory.

How should i disable the button to avoid further upload action

Add a JavaScript routine to the button after it is clicked and then enable
it again after upload is completed.

One good product for upload, that handles a lot of this plumbing is
http://www.telerik.com/products/aspnet-ajax/upload.aspx

If you want to code your own, check this out
http://bit.ly/ADtRk

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
T

Tony WONG

Thanks a Gregory

it is a new idea to me.


Gregory A. Beamer said:
Add a JavaScript routine to the button after it is clicked and then enable
it again after upload is completed.

One good product for upload, that handles a lot of this plumbing is
http://www.telerik.com/products/aspnet-ajax/upload.aspx

If you want to code your own, check this out
http://bit.ly/ADtRk

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

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

Top