Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 20th, 2006, 01:33 PM
Registered User
 
Join Date: May 2005
Location: , , .
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.
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


Reply With Quote
  #2 (permalink)  
Old October 21st, 2006, 03:38 AM
Imar's Avatar
Wrox Author
Points: 67,253, Level: 100
Points: 67,253, Level: 100 Points: 67,253, Level: 100 Points: 67,253, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,225
Thanks: 66
Thanked 1,413 Times in 1,393 Posts
Default

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
---------------------------------------
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 07:45 AM
Web Parts not supported in Atlas Application?? savan_thakkar ASP.NET 2.0 Professional 0 November 2nd, 2006 04:20 AM
Building an E-Shop Varg_88 Beginning PHP 0 March 15th, 2006 04: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 05:37 AM



All times are GMT -4. The time now is 05:08 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.