Why is my <UpdatePanel> throwing a "Parameter not valid" error message?

Last post 06-07-2007 8:32 AM by Dugald. 2 replies.

Sort Posts:

  • Why is my <UpdatePanel> throwing a "Parameter not valid" error message?

    06-07-2007, 1:13 AM
    • Member
      191 point Member
    • Jason Duncan
    • Member since 07-11-2006, 10:19 PM
    • Austin, TX
    • Posts 102

    Hello,

    I'm using Ajax 1.0.  I have a very basic file upload page that uses a Master page (master page has the ScriptManager declared).  I just want to do the basic "spinning gif" when the Upload button is pressed.  My page works fine without ajax.  However, with the ajax code I get a popup that says "Parameter is not valid" when I press the "Upload" button.  I've searched everywhere and tried a number of different ways, but still no luck.  I would greatly appreciate any help or insight!  :)   Also, all my other Ajax extenders (ie, CalendarExtender, etc) work just fine.

    Thanks, Jason

    MasterPage:

    <asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />

    File Upload page:

            <asp:View ID="uploadimageview" runat="server">
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" SelectCommand="SELECT albumid, albumName FROM Albums"
                    ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>" OnSelecting="SetOwner"></asp:SqlDataSource>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="UploadBtn" EventName="Click" />
                    </Triggers>
                    <ContentTemplate>

                        <table class="selectedPanel" width="100%">
                            <tr>
                                <td colspan="2">
                                    Select a file using the browse button, enter a caption title and click Upload Image.
                                    <br />
                                    <asp:Label ID="ErrorLabel" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="height: 26px">
                                    Album to upload to:</td>
                                <td style="height: 26px">
                                    <asp:DropDownList ID="AlbumList2" runat="server" DataSourceID="SqlDataSource3" DataTextField="albumName"
                                        DataValueField="albumid">
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td>
                                    File:</td>
                                <td>
                                    <asp:FileUpload ID="FileUpload1" runat="server" /></td>
                            </tr>
                            <tr>
                                <td>
                                    Image title:</td>
                                <td>
                                    <asp:TextBox ID="Title" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <p>
                                    </p>
                                    <asp:Button ID="UploadBtn" runat="server" Text="Upload Image" OnClick="UploadBtn_Click" />
                                    <asp:Button ID="Cancel2" runat="server" Text="Cancel upload" OnClick="Cancel_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;</td>
                            </tr>
                        </table>
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                            <ProgressTemplate>
                                Updating...</ProgressTemplate>
                        </asp:UpdateProgress>
                    </ContentTemplate>
                </asp:UpdatePanel>

            </asp:View> " OnSelecting="SetOwner">

    Select a file using the browse button, enter a caption title and click Upload Image.
     
    Album to upload to:
    File:
    Image title:
     

     

     
    Updating... -->

     

  • Re: Why is my <UpdatePanel> throwing a "Parameter not valid" error message?

    06-07-2007, 8:29 AM
    Answer
    • Member
      191 point Member
    • Jason Duncan
    • Member since 07-11-2006, 10:19 PM
    • Austin, TX
    • Posts 102

    Problem was that FileUpload1.FileContent was being lost by the UpdatePanel.

    Jason

  • Re: Why is my <UpdatePanel> throwing a "Parameter not valid" error message?

    06-07-2007, 8:32 AM
    • Member
      444 point Member
    • Dugald
    • Member since 05-07-2007, 10:51 AM
    • Raleigh, NC
    • Posts 85

     The error could be caused by having the FileUpload control in the UpdatePanel.

     This post links to some more information: http://forums.asp.net/t/1107788.aspx
     

Page 1 of 1 (3 items)