|
-
Apr 24th, 2013, 12:08 AM
#1
Thread Starter
Lively Member
I need help displaying an image
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
-
Apr 24th, 2013, 10:37 AM
#2
Re: I need help displaying an image
Moved to the ASP.Net forum.
-
Apr 24th, 2013, 08:11 PM
#3
Re: I need help displaying an image
Don't think you can give code to an <img />.
You need the url of the image.
About the first.It won't really matter what you will see on your own PC. Better test it on a server and see the behavior there.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
May 2nd, 2013, 11:48 AM
#4
Thread Starter
Lively Member
Re: I need help displaying an image
Hello Sapator
Thanks for your reply. Do you think you can provide me with an example on how use the URL or how can i change the line bolow?
HTML Code:
<img src="string url = ResolveUrl("~/ImageStorage/" + filename)" />
Thank you in advance
BK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|