I created a page to edit products. for some reason it is not seeing that i have an item in the fileupload control box. IT just says cannot insert null item into picturesurlsmall. If i remove atlas and the update panel from my page it works fine.
I used more of the code that was already in the add products
vb file
here is my
vb code i can get you my ASP.net code if you need it.
Code:
Protected Sub DetailsView_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) _
Handles DetailsView1.ItemUpdating
Dim dv As DetailsView = DetailsView1
' ' ' Find the Selected Category Name ID Value
Dim CatIDup As Integer = CType(dv.FindControl("ddlCat"), DropDownList).SelectedValue
' ' sdsevents.UpdateParameters.Clear()
sdsGetProduct.UpdateParameters.Add("categoryId", CatIDup)
Try
' First. try to save the images
Dim theFileUpload As FileUpload = CType( _
DetailsView1.FindControl("FileUpload1"), FileUpload)
If theFileUpload.HasFile Then
Dim fileNameSmall As String = "~/Images/Products/" & Guid.NewGuid.ToString()
Dim fileNameMedium As String = "~/Images/Products/" & Guid.NewGuid.ToString()
Dim fileNameLarge As String = "~/Images/Products/" & Guid.NewGuid.ToString()
Dim theExtension As String = Path.GetExtension(theFileUpload.FileName)
fileNameSmall &= theExtension
fileNameMedium &= theExtension
fileNameLarge &= theExtension
theFileUpload.SaveAs(Server.MapPath(fileNameLarge))
' Now resize the images
Helpers.ResizeImage(Server.MapPath(fileNameLarge), _
Server.MapPath(fileNameSmall), 40)
Helpers.ResizeImage(Server.MapPath(fileNameLarge), _
Server.MapPath(fileNameMedium), 100)
Helpers.ResizeImage(Server.MapPath(fileNameLarge), _
Server.MapPath(fileNameLarge), 250)
e.NewValues("PictureUrlSmall") = fileNameSmall
e.NewValues("PictureUrlMedium") = fileNameMedium
e.NewValues("PictureUrlLarge") = fileNameLarge
End If
Catch ex As Exception
Throw
End Try
End Sub