Advertisement

08.21.2008 at 02:12PM PDT, ID: 23668532
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Show label and image when file is uploading

Asked by flukester in Programming for ASP.NET, .NET, Microsoft Visual Basic.Net

Tags:

I would like to display a label and image when someone clicks the submit button to upload a file. I've been tinkering around with progress bars, but none seem to work correctly with the rest of my code. What I though I could do is simply show a label and image when someone clicks the button, however the label and image don't show up until after the upload takes place. I'm assuming this is because the click event for the browse button on a Fileupload control is the same as the button_click event I think. Anyway, below is the code I'm trying to use:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        btnProgress.Visible = False
        lblProgress.Visible = False
    End Sub

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click


        'before submitting make sure there is a file
        If FileUpload1.HasFile Then
        btnProgress.Visible = True
        lblProgress.Visible = True

            SaveFile(FileUpload1.PostedFile)

        Else
            lblUploadResult.Text = "Your file was not uploaded properly, please try again or contact the webmaster at emailaddresshere."
        End If


    End Sub

    Sub SaveFile(ByVal file As HttpPostedFile)
       
        'Path where file is uploaded
        Dim savePath As String = System.Configuration.ConfigurationManager.AppSettings("UploadFolderHere")

        'Get name of client file and then extract extension
        Dim extension As String = FileUpload1.FileName
        Dim ext As String = System.IO.Path.GetExtension(extension)

        'name of file
        Dim fileName As String = txtPresNumber.Text & "_" & txtLastName.Text + ext



        'Create path and filename to check dups
        Dim checkPath As String = savePath + fileName

        'temp filename to check dups
        Dim tempFileName As String

        If (System.IO.File.Exists(checkPath)) Then
            Dim counter As Integer = 1
            While (System.IO.File.Exists(checkPath))
                tempFileName = counter.ToString() & "_" & fileName
                checkPath = savePath + tempFileName
                counter = counter + 1
            End While
            fileName = tempFileName

            lblUploadResult.Text = "Thank you very much, your file has been received."
        Else
            lblUploadResult.Text = "Thank you very much, your file has been received."

        End If

        'Append Name
        savePath += fileName

        'Call save as method
        FileUpload1.SaveAs(savePath)



Start Free Trial
 
Loading Advertisement...
 
[+][-]08.21.2008 at 02:39PM PDT, ID: 22284567

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 06:16PM PDT, ID: 22285633

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.22.2008 at 08:41AM PDT, ID: 22291165

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 09:36AM PDT, ID: 22306889

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.25.2008 at 03:36PM PDT, ID: 22309951

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, .NET, Microsoft Visual Basic.Net
Tags: vb.net
Sign Up Now!
Solution Provided By: jpaulino
Participating Experts: 3
Solution Grade: B
 
 
[+][-]08.26.2008 at 03:26PM PDT, ID: 22320366

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.28.2008 at 01:02PM PDT, ID: 22339206

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628