Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27077

VS 2010 I need help displaying an image

$
0
0
Hello Everyone

I am new in vesual basic and i have a couple of questions:

I have the following code that is allowing me to save an image uploaded from a user into a root folder
HTML Code:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim fileName As String = Path.GetFileName(FileUploadUserProfile.PostedFile.FileName)

        FileUploadUserProfile.PostedFile.SaveAs((Server.MapPath("~/ImageStorage/") + fileName))

        Response.Redirect(Request.Url.AbsoluteUri)
    End Sub

Question one:
Once i upload the file and i click on the ImageStorage folder, i don't see an image, but if i exit the entire applicxation and then i go back in i am able to see the image. How can i refresh the folder wothout having to exit the application?

Question two:
I am trying to display the image once is uploaded. i have the following to display the image:
HTML Code:

<img src="string url = ResolveUrl("~/ImageStorage/" + filename)" />
once the page is uploaded i don't see an image, instead i see a little square with a red X

Thank you for your help

BK

Viewing all articles
Browse latest Browse all 27077

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>