Click here to Skip to main content
15,889,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Coders,
I am Facing a minor issue. i can insert image using listview but when i try to Update image in EditMode i am unable to Update new image.
Please Help me.
Its NewBie here.

THIS CODE IS FOR INSETING IMAGE
Protected Sub EntityDataSource1_Inserting(sender As Object, e As EntityDataSourceChangingEventArgs) Handles EntityDataSource1.Inserting
Dim PhotoID As Integer = Convert.ToInt32(Request.QueryString.Get("PhotoID"))


Dim photo As D_Photo = CType(e.Entity, D_Photo)
photo.PhotoID = PhotoID

Dim FileUpload1 As FileUpload = CType(ListView1.InsertItem.FindControl("FileUpload1"), FileUpload)
Dim VirtualFolder As String = "~/Pics/"
Dim PhysicalFolder As String = Server.MapPath(VirtualFolder)
Dim FileName As String = Guid.NewGuid.ToString

Dim Extension As String = System.IO.Path.GetExtension(FileUpload1.FileName)

FileUpload1.SaveAs(System.IO.Path.Combine(PhysicalFolder, FileName + Extension))

photo.PhotoImage = VirtualFolder + FileName + Extension

'VS()
End Sub
NOw tell me what should i do to Edit this image.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900