Wrox Programmer Forums
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 20th, 2006, 01:33 PM
Registered User
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default atlas and web shop

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.
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)
            ' 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
                ' 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
        End Try

    End Sub

Old October 21st, 2006, 03:38 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi gtjr92,

I think this is a problem with Atlas and the UpdatePanel where the uploaded file isn't handled correctly.

Take a look here: http://www.nikhilk.net/AtlasM1Refresh.aspx

It discusses the problem and offers some work arounds (haven't tested them yet). If that doesn't help, searching Google for atlas upload file should give you some useful results.

Hope this helps,

Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 8, shop Beowulf BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 3 September 30th, 2010 03:59 PM
Does asp.net atlas should be installed in web serv arulkumar ASP.NET 2.0 Basics 1 February 12th, 2007 08:45 AM
Web Parts not supported in Atlas Application?? savan_thakkar ASP.NET 2.0 Professional 0 November 2nd, 2006 05:20 AM
Building an E-Shop Varg_88 Beginning PHP 0 March 15th, 2006 05:25 AM
WroxUnited Shop datae33 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 March 4th, 2006 06:37 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.