Link to home
Start Free TrialLog in
Avatar of Todd Penland
Todd PenlandFlag for United States of America

asked on

ASP.NET 2.0: Could not find control 'CONTROLNAME' in ControlParameter 'PARAMETERNAME'

Another ASP.NET 2.0 newbie question.  An error has popped up somewhere in my application which (from reading the following error message) seems to have something to do with one or more of the parameters on one of my data objects.  'lstMakes' is the name of a control in my application and 'MakeID' is the name of one of my parameters.  Try as I might, I can't find the error.  I can't even tell when the error is occurring and I'm so new at this I don't know how to debug the application.  In the good old days I could step through my code and at least find out where the error happens.  So far I haven't found any way to do that in ASP.NET 2.0.  Can anyone offer any suggestions?  Thanks!

-------------------------------------------------------
Could not find control 'lstMakes' in ControlParameter 'MakeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'lstMakes' in ControlParameter 'MakeID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: Could not find control 'lstMakes' in ControlParameter 'MakeID'.]
   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +382
   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +70
   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +135
   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +52
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +96
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4087

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Avatar of Todd Penland
Todd Penland
Flag of United States of America image

ASKER

Here's my HTML
------------------------------------------------

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Default.aspx.vb" Inherits="ForSale_AddItem_Default"
    Title="Add Items For Sale" Debug="true"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
    runat="Server">
    <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" HeaderText="Add New Item"
        HeaderStyle-BackColor="Red" HeaderStyle-Font-Bold="True"
        HeaderStyle-ForeColor="White" HeaderStyle-Font-Size="X-Small"
        HeaderStyle-HorizontalAlign="Center" SideBarStyle-VerticalAlign="Top"
        SideBarStyle-BackColor="Red" SideBarStyle-Font-Size="XX-Small"
        SideBarStyle-Font-Names="verdana" SideBarStyle-ForeColor="White"
        SideBarStyle-Width="100" StepStyle-ForeColor="White" SideBarButtonStyle-Font-Size="X-Small"
        SideBarButtonStyle-ForeColor="White">
        <WizardSteps>
            <asp:WizardStep runat="server" Title="Item Type">
                <table width="100%">
                    <tr>
                        <td valign="top">
                            <asp:ListBox ID="lstItemType" runat="server" AutoPostBack="True">
                            </asp:ListBox>
                        </td>
                        <td valign="top">
                            <asp:Button ID="cmdEditItemType" runat="server" Text="Edit" Enabled="False"
                                Visible="False" Width="65px" />
                        </td>
                        <td valign="top">
                            <asp:TextBox ID="txtUpdateItemType" runat="server" Enabled="False"
                                Visible="False"></asp:TextBox><br />
                            <asp:Button ID="cmdUpdateItemType" runat="server" Text="Update"
                                Enabled="False" Visible="False" />
                            <asp:Button ID="cmdCancelUpdateItemType" runat="server" Text="Cancel"
                                Enabled="False" Visible="False" />
                        </td>
                        <td valign="top">
                            <font color="black">Select the type of item you wish to sell</font>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        <td colspan="3">
                            <asp:Label ID="lblMessageItemType" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Description">
                <table>
                    <tr>
                        <td>
                            <table>
                                <!--Controls for description of auto parts (contain multi-select Make and Model lists)-->
                                <!--Not visible unless 'Auto Parts' Selected under 'Item Type'-->
                                <tr>
                                    <td>
                                        <asp:Label ID="lblMakesMulti" runat="server" Text="Select Make(s)"
                                            ForeColor="Black" Visible="False"></asp:Label>
                                    </td>
                                    <td>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <asp:ListBox ID="lstMakes" runat="server" SelectionMode="Multiple"
                                                        Visible="False" AutoPostBack="True" Width="150px"></asp:ListBox>
                                                </td>
                                                <td valign="top">
                                                    <asp:Button ID="cmdSelectAllMakes" runat="server" Text="Select All"
                                                        Width="100px" />
                                                    <asp:Button ID="cmdSelectNoneMakes" runat="server" Text="Select None"
                                                        Width="100px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblModelsMulti" runat="server" Text="Select Model(s)"
                                            ForeColor="Black" Visible="False"></asp:Label>
                                    </td>
                                    <td>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <asp:ListBox ID="lstModels" runat="server" SelectionMode="Multiple"
                                                        Visible="False" AutoPostBack="True" Width="150px"></asp:ListBox>
                                                </td>
                                                <td valign="top">
                                                    <asp:Button ID="cmdSelectAllModels" runat="server" Text="Select All"
                                                        Width="100px" />
                                                    <asp:Button ID="cmdSelectNoneModels" runat="server" Text="Select None"
                                                        Width="100px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <!--Controls for description of autos (contain multi-select Make and Model lists)-->
                                <!--Default Selection-->
                                <tr>
                                    <td>
                                        <asp:Label ID="lblMake" runat="server" Text="Make" ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:DropDownList ID="cboMake" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblModel" runat="server" Text="Model" ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:DropDownList ID="cboModel" runat="server">
                                        </asp:DropDownList>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Button ID="cmdNewMake" runat="server" Text="New Make" Enabled="False" />
                                        <asp:Button ID="cmdNewModel" runat="server" Text="New Model"
                                            Enabled="False" /></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblShortDesc" runat="server" Text="Short Description"
                                            ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="txtShortDesc" runat="server" Width="300px"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblDesc" runat="server" Text="Full Description"
                                            ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="txtDesc" runat="server" Width="300px" Rows="6"
                                            TextMode="MultiLine"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblPrice" runat="server" Text="Price" ForeColor="Black"></asp:Label>
                                    </td>
                                    <td>
                                        <font color="black">$<asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                                            (US Dollars)</font>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <font color="black">Describe the item you wish to sell</font>
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Photos">
                <table>
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblUpload" runat="server" Text="File" ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:FileUpload ID="FileUpload1" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Button ID="cmdUpload" runat="server" Text="Upload" /></td>
                                </tr>
                            </table>
                        </td>
                        <td valign="top">
                            <font color="Black">Enter the location(s) of the file(s) you wish
                                to upload</font></td>
                    </tr>
                </table>
            </asp:WizardStep>
        </WizardSteps>
        <StepStyle ForeColor="White" />
        <SideBarStyle BackColor="Red" Font-Names="verdana" Font-Size="XX-Small"
            ForeColor="White" VerticalAlign="Top" Width="100px" />
        <SideBarButtonStyle Font-Size="X-Small" ForeColor="White" />
        <HeaderStyle BackColor="Red" Font-Bold="True" Font-Size="X-Small"
            ForeColor="White" HorizontalAlign="Center" />
    </asp:Wizard>
    <asp:SqlDataSource ID="sdsMakes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
        ProviderName="System.Data.SqlClient" SelectCommand="spMakesSelect"
        SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsModels" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
        ProviderName="System.Data.SqlClient" SelectCommand="spModelSelectByMake"
        SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="lstMakes" Name="MakeID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsSaleItemTypes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
        ProviderName="System.Data.SqlClient" SelectCommand="spSaleItemTypesSelect"
        SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</asp:Content>
And here's my Code-Behind
-------------------------------------------------------------


Imports System.Data
Imports System.Data.SqlClient
Partial Class ForSale_AddItem_Default
    Inherits System.Web.UI.Page

    Protected Sub Wizard1_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.NextButtonClick
        With Me
            Select Case .lstItemType.SelectedValue
                Case 1, 3 'Automobiles & Parts Cars/Trucks
                    .lstMakes.Visible = False
                    .lstModels.Visible = False
                    .lblMakesMulti.Visible = False
                    .lblModelsMulti.Visible = False
                    .cmdSelectAllMakes.Visible = False
                    .cmdSelectNoneMakes.Visible = False
                    .cmdSelectAllModels.Visible = False
                    .cmdSelectNoneModels.Visible = False
                    .cboMake.Visible = True
                    .cboModel.Visible = True
                    .lblMake.Visible = True
                    .lblModel.Visible = True
                    .cmdNewMake.Visible = True
                    .cmdNewModel.Visible = True
                Case 2 'Auto Parts
                    .lstMakes.Visible = True
                    .lstModels.Visible = True
                    .lblMakesMulti.Visible = True
                    .lblModelsMulti.Visible = True
                    .cmdSelectAllMakes.Visible = True
                    .cmdSelectNoneMakes.Visible = True
                    .cmdSelectAllModels.Visible = True
                    .cmdSelectNoneModels.Visible = True
                    .cboMake.Visible = False
                    .cboModel.Visible = False
                    .lblMake.Visible = False
                    .lblModel.Visible = False
                    .cmdNewMake.Visible = True
                    .cmdNewModel.Visible = True
                Case 4
                    .lstMakes.Visible = False
                    .lstModels.Visible = False
                    .lblMakesMulti.Visible = False
                    .lblModelsMulti.Visible = False
                    .cmdSelectAllMakes.Visible = False
                    .cmdSelectNoneMakes.Visible = False
                    .cmdSelectAllModels.Visible = False
                    .cmdSelectNoneModels.Visible = False
                    .cboMake.Visible = False
                    .cboModel.Visible = False
                    .lblMake.Visible = False
                    .lblModel.Visible = False
                    .cmdNewMake.Visible = False
                    .cmdNewModel.Visible = False
            End Select
        End With
    End Sub

    Protected Sub lstItemType_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstItemType.SelectedIndexChanged
        With Me
            If lstItemType.SelectedValue = "" Then
                .cmdEditItemType.Enabled = False
                .cmdEditItemType.Visible = False
            Else
                .cmdEditItemType.Enabled = True
                .cmdEditItemType.Visible = True
            End If
        End With
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Me.IsPostBack Then
            If Me.lstMakes.SelectedValue <> "" Then
                Models_BindData()
            End If
        Else
            ItemType_BindData()
            Makes_BindData()
        End If
    End Sub

    Protected Sub ItemType_BindData()
        With Me
            .lstItemType.DataSource = .sdsSaleItemTypes
            .lstItemType.DataTextField = "fldSaleItemTypeDesc"
            .lstItemType.DataValueField = "fldSaleItemTypeID"
            .lstItemType.DataBind()
        End With
    End Sub

    Protected Sub Makes_BindData()
        With Me
            .lstMakes.DataSource = .sdsMakes
            .lstMakes.DataTextField = "Description"
            .lstMakes.DataValueField = "ID"
            .lstMakes.DataBind()
        End With
    End Sub

    Protected Sub Models_BindData()
        With Me
            .lstModels.DataSource = .sdsModels
            .lstModels.DataTextField = "Description"
            .lstModels.DataValueField = "ID"
            .lstModels.DataBind()
        End With
    End Sub

    Protected Sub cmdEditItemType_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdEditItemType.Click
        With Me
            If .lstItemType.SelectedValue = "" Then
            Else
                .lstItemType.Enabled = False
                .cmdEditItemType.Enabled = False
                .txtUpdateItemType.Enabled = True
                .txtUpdateItemType.Visible = True
                .txtUpdateItemType.Text = .lstItemType.SelectedItem.Text
                .cmdUpdateItemType.Enabled = True
                .cmdUpdateItemType.Visible = True
                .cmdCancelUpdateItemType.Enabled = True
                .cmdCancelUpdateItemType.Visible = True
            End If
        End With
    End Sub

    Protected Sub cmdUpdateItemType_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdUpdateItemType.Click
        Dim strItemTypeToUpdate As String = Trim(Me.txtUpdateItemType.Text)

        If Len(strItemTypeToUpdate) <> 0 Then
            Dim sConnStr As String = ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString
            Dim cnWDOA As New SqlConnection(sConnStr)
            Dim cmdMakeUpdate As New SqlCommand("spSaleItemTypeUpdate", cnWDOA)

            cmdMakeUpdate.CommandType = Data.CommandType.StoredProcedure

            cmdMakeUpdate.Parameters.Add(New SqlParameter("@SaleItemTypeID", Data.SqlDbType.Int))
            cmdMakeUpdate.Parameters.Add(New SqlParameter("@SaleItemTypeDesc", Data.SqlDbType.NVarChar, 50))
            cmdMakeUpdate.Parameters("@SaleItemTypeID").Value = Me.lstItemType.SelectedItem.Value
            cmdMakeUpdate.Parameters("@SaleItemTypeDesc").Value = Me.txtUpdateItemType.Text

            cnWDOA.Open()
            cmdMakeUpdate.ExecuteNonQuery()
            cnWDOA.Close()

            ItemType_BindData()
            txtUpdateItemType.Text = ""

            With Me
                .txtUpdateItemType.Enabled = False
                .txtUpdateItemType.Visible = False
                .cmdUpdateItemType.Enabled = False
                .cmdUpdateItemType.Visible = False
                .cmdCancelUpdateItemType.Enabled = False
                .cmdCancelUpdateItemType.Visible = False
                .lstItemType.Enabled = True
                .cmdEditItemType.Enabled = False
                .cmdEditItemType.Visible = False
                .lblMessageItemType.Text = ""
                .lblMessageItemType.Visible = False
            End With
        Else
            lblMessageItemType.Text = "Please enter a valid name for the Item Type you are trying to update."
            lblMessageItemType.Visible = True
            txtUpdateItemType.Focus()
        End If
    End Sub

    Protected Sub cmdCancelUpdateItemType_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCancelUpdateItemType.Click
        With Me
            .txtUpdateItemType.Text = ""
            .cmdUpdateItemType.Enabled = False
            .cmdUpdateItemType.Visible = False
            .txtUpdateItemType.Enabled = False
            .txtUpdateItemType.Visible = False
            .cmdCancelUpdateItemType.Enabled = False
            .cmdCancelUpdateItemType.Visible = False
            .lstItemType.Enabled = True
            .cmdEditItemType.Enabled = True
        End With
    End Sub
End Class
Avatar of bele04
bele04

Hi,

I'm not quite sure about this but try it if it works:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Me.IsPostBack Then
            If Me.lstMakes.SelectedValue <> "" Then
                sdsModels.Parameters("MakeID").DefaultValue = (Wizard1.FindControl("lstMakes")).SelectedValue
                Models_BindData()
            End If
        Else
            ItemType_BindData()
            Makes_BindData()
        End If
    End Sub

I'm guessing here that your controlparameter couldn't access directly your lstMakes control so it can't find it once it tries to execute the selectcommand of your sqldatasource which is during the pageload event of your page.

-bele04-
Thanks.  OK...I immediately got two errors:

Error      1      'Parameters' is not a member of 'System.Web.UI.WebControls.SqlDataSource'.      CodeBehindFilePath      62      17      ApplicationPath

Error      2      'SelectedValue' is not a member of 'System.Web.UI.Control'.      CodeBehindFilePath      62      63      ApplicationPath
i'm not quite sure bout the statement i added...but its something like that...

try omitting the 's' in Parameters and for the SelectedValue error try something that gets the value of the control being returned by the Wizard1.FindControl("lstMakes") statement.
Change this line
<SelectParameters>
            <asp:ControlParameter ControlID="lstMakes" Name="MakeID" PropertyName="SelectedValue"
                Type="Int32" />

to
<SelectParameters>
            <asp:ControlParameter ControlID="lstMakes" Name="$MakeID" PropertyName="SelectedValue"
                Type="Int32" />

If its still doesnt work add runat="server" give it an ID lets says tblContainer, then change the name property of the control parameter to tblContainer$MakeID

Post back results please

Good luck
OK...first I changed it to this:

        <SelectParameters>
            <asp:ControlParameter ControlID="lstMakes" Name="$MakeID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>

And this is what I got:

Could not find control 'lstMakes' in ControlParameter '$MakeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'lstMakes' in ControlParameter '$MakeID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: Could not find control 'lstMakes' in ControlParameter '$MakeID'.]
   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +382
   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +70
   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +135
   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +52
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +96
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4087

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Then I tried adding an 'ID' tag to the parameter and got the following error:

Error      1      Validation (ASP.Net): Attribute 'ID' is not a valid attribute of element 'ControlParameter'.      ASPXPagePath      196      35      ApplicationPath
penlandt,
I am terribly sorry, I madea mistake in my code
You need to leave the name property like you had and do the changes in the controlID like I did

Let me know if that helps

Hold on a I will adjust the code and post it for you
give me 2 minutes
I apologize for being a little slow on the uptake...but I don't see any change in the ControlID in your example.  Could you elaborate a little?  Thanks!
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
    runat="Server">
    <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" HeaderText="Add New Item"
        HeaderStyle-BackColor="Red" HeaderStyle-Font-Bold="True"
        HeaderStyle-ForeColor="White" HeaderStyle-Font-Size="X-Small"
        HeaderStyle-HorizontalAlign="Center" SideBarStyle-VerticalAlign="Top"
        SideBarStyle-BackColor="Red" SideBarStyle-Font-Size="XX-Small"
        SideBarStyle-Font-Names="verdana" SideBarStyle-ForeColor="White"
        SideBarStyle-Width="100" StepStyle-ForeColor="White" SideBarButtonStyle-Font-Size="X-Small"
        SideBarButtonStyle-ForeColor="White">
        <WizardSteps>
            <asp:WizardStep runat="server" Title="Item Type">
                <table width="100%">
                    <tr>
                        <td valign="top">
                            <asp:ListBox ID="lstItemType" runat="server" AutoPostBack="True">
                            </asp:ListBox>
                        </td>
                        <td valign="top">
                            <asp:Button ID="cmdEditItemType" runat="server" Text="Edit" Enabled="False"
                                Visible="False" Width="65px" />
                        </td>
                        <td valign="top">
                            <asp:TextBox ID="txtUpdateItemType" runat="server" Enabled="False"
                                Visible="False"></asp:TextBox><br />
                            <asp:Button ID="cmdUpdateItemType" runat="server" Text="Update"
                                Enabled="False" Visible="False" />
                            <asp:Button ID="cmdCancelUpdateItemType" runat="server" Text="Cancel"
                                Enabled="False" Visible="False" />
                        </td>
                        <td valign="top">
                            <font color="black">Select the type of item you wish to sell</font>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        <td colspan="3">
                            <asp:Label ID="lblMessageItemType" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Description">
                <table>
                    <tr>
                        <td>
                            <table>
                                <!--Controls for description of auto parts (contain multi-select Make and Model lists)-->
                                <!--Not visible unless 'Auto Parts' Selected under 'Item Type'-->
                                <tr>
                                    <td>
                                        <asp:Label ID="lblMakesMulti" runat="server" Text="Select Make(s)"
                                            ForeColor="Black" Visible="False"></asp:Label>
                                    </td>
                                    <td>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <asp:ListBox ID="lstMakes" runat="server" SelectionMode="Multiple"
                                                        Visible="False" AutoPostBack="True" Width="150px"></asp:ListBox>
                                                </td>
                                                <td valign="top">
                                                    <asp:Button ID="cmdSelectAllMakes" runat="server" Text="Select All"
                                                        Width="100px" />
                                                    <asp:Button ID="cmdSelectNoneMakes" runat="server" Text="Select None"
                                                        Width="100px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblModelsMulti" runat="server" Text="Select Model(s)"
                                            ForeColor="Black" Visible="False"></asp:Label>
                                    </td>
                                    <td>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <asp:ListBox ID="lstModels" runat="server" SelectionMode="Multiple"
                                                        Visible="False" AutoPostBack="True" Width="150px"></asp:ListBox>
                                                </td>
                                                <td valign="top">
                                                    <asp:Button ID="cmdSelectAllModels" runat="server" Text="Select All"
                                                        Width="100px" />
                                                    <asp:Button ID="cmdSelectNoneModels" runat="server" Text="Select None"
                                                        Width="100px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <!--Controls for description of autos (contain multi-select Make and Model lists)-->
                                <!--Default Selection-->
                                <tr>
                                    <td>
                                        <asp:Label ID="lblMake" runat="server" Text="Make" ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:DropDownList ID="cboMake" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblModel" runat="server" Text="Model" ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:DropDownList ID="cboModel" runat="server">
                                        </asp:DropDownList>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Button ID="cmdNewMake" runat="server" Text="New Make" Enabled="False" />
                                        <asp:Button ID="cmdNewModel" runat="server" Text="New Model"
                                            Enabled="False" /></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblShortDesc" runat="server" Text="Short Description"
                                            ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="txtShortDesc" runat="server" Width="300px"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblDesc" runat="server" Text="Full Description"
                                            ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:TextBox ID="txtDesc" runat="server" Width="300px" Rows="6"
                                            TextMode="MultiLine"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblPrice" runat="server" Text="Price" ForeColor="Black"></asp:Label>
                                    </td>
                                    <td>
                                        <font color="black">$<asp:TextBox ID="txtPrice" runat="server"></asp:TextBox>
                                            (US Dollars)</font>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <font color="black">Describe the item you wish to sell</font>
                        </td>
                    </tr>
                </table>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="Photos">
                <table>
                    <tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblUpload" runat="server" Text="File" ForeColor="Black"></asp:Label></td>
                                    <td>
                                        <asp:FileUpload ID="FileUpload1" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Button ID="cmdUpload" runat="server" Text="Upload" /></td>
                                </tr>
                            </table>
                        </td>
                        <td valign="top">
                            <font color="Black">Enter the location(s) of the file(s) you wish
                                to upload</font></td>
                    </tr>
                </table>
            </asp:WizardStep>
        </WizardSteps>
        <StepStyle ForeColor="White" />
        <SideBarStyle BackColor="Red" Font-Names="verdana" Font-Size="XX-Small"
            ForeColor="White" VerticalAlign="Top" Width="100px" />
        <SideBarButtonStyle Font-Size="X-Small" ForeColor="White" />
        <HeaderStyle BackColor="Red" Font-Bold="True" Font-Size="X-Small"
            ForeColor="White" HorizontalAlign="Center" />
    </asp:Wizard>
    <asp:SqlDataSource ID="sdsMakes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
        ProviderName="System.Data.SqlClient" SelectCommand="spMakesSelect"
        SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsModels" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
        ProviderName="System.Data.SqlClient" SelectCommand="spModelSelectByMake"
        SelectCommandType="StoredProcedure">
        <SelectParameters>
<!--NOTES:Changes using the ContentID + $ + lsMakes -->
            <asp:ControlParameter ControlID="Content1$lstMakes" Name="MakeID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsSaleItemTypes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>"
        ProviderName="System.Data.SqlClient" SelectCommand="spSaleItemTypesSelect"
        SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</asp:Content>

<!--Note: the code adjustment in my comment and if that doesnt work try it with this <asp:ControlParameter ControlID="ContentPlaceHolder1$lstMakes" Name="MakeID" PropertyName="SelectedValue"
                Type="Int32" />-->


read my last post, try it and let me know
Allright...on the first try I got this:

Could not find control 'Content1$lstMakes' in ControlParameter 'MakeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'Content1$lstMakes' in ControlParameter 'MakeID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: Could not find control 'Content1$lstMakes' in ControlParameter 'MakeID'.]
   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +382
   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +70
   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +135
   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +52
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +96
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4087

 
Then when I changed to:

            <asp:ControlParameter ControlID="ContentPlaceHolder1$lstMakes" Name="MakeID" PropertyName="SelectedValue"
                Type="Int32" />

I got this:

Could not find control 'ContentPlaceHolder1$lstMakes' in ControlParameter 'MakeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control 'ContentPlaceHolder1$lstMakes' in ControlParameter 'MakeID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: Could not find control 'ContentPlaceHolder1$lstMakes' in ControlParameter 'MakeID'.]
   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +382
   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +70
   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +135
   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +52
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +96
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4087

 
This is turning out to be my most intractable problem yet :-(
Can you comment those lines and post the html from the browser, View source and copy the HTML then post it here
Comment the whole datasource tag?  Or just the parameter?
the parameter only

Well...at least I know we're looking in the right place now.  Without the parameter, the page works until I select a "Make".  Here's the HTML:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
      Add Items For Sale
</title><link href="../../App_Themes/Default/StyleSheet.css" type="text/css" rel="stylesheet" /></head>
<body>
    <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNDQ5OTY3MzA3D2QWAmYPZBYCAgMPZBYCAg0PZBYCAgEPZBYCZg9kFgJmD2QWAgIBD2QWAmYPZBYCAgEPZBYCZg9kFgJmD2QWBGYPZBYEAgEPEA8WBh4NRGF0YVRleHRGaWVsZAUTZmxkU2FsZUl0ZW1UeXBlRGVzYx4ORGF0YVZhbHVlRmllbGQFEWZsZFNhbGVJdGVtVHlwZUlEHgtfIURhdGFCb3VuZGdkEBUEFVByb2plY3QgQ2FycyAmIFRydWNrcxJDbGFzc2ljIEF1dG8gUGFydHMTUGFydHMgQ2FycyAmIFRydWNrcwVPdGhlchUEATEBMgEzATQUKwMEZ2dnZxYBAgFkAgMPDxYEHgdFbmFibGVkZx4HVmlzaWJsZWdkZAIBD2QWEAIBDw8WAh8EZ2RkAgMPEA8WCB8ABQtEZXNjcmlwdGlvbh8BBQJJRB8CZx8EZ2QQFQsKQWxmYSBSb21lbwNCTVcJQ2hldnJvbGV0CENocnlzbGVyBURvZGdlBEZvcmQLTGFtYm9yZ2hpbmkIUGx5bW91dGgGVHVja2VyClZvbGtzd2FnZW4FV2lsbHkVCwE4AjEwATEBMwE0ATIBOQE2AjExATcBNRQrAwtnZ2dnZ2dnZ2dnZ2RkAgkPDxYCHwRnZGQCCw8QDxYCHwRnZGRkZAIRDw8WAh8EaGRkAhMPEA8WAh8EaGRkFgBkAhUPDxYCHwRoZGQCFw8QDxYCHwRoZGQWAGQYBAUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgwFI2N0bDAwJExvZ2luVmlldzEkTG9naW5TdGF0dXMxJGN0bDAxBSNjdGwwMCRMb2dpblZpZXcxJExvZ2luU3RhdHVzMSRjdGwwMwUqY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRXaXphcmQxJGxzdE1ha2VzBStjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFdpemFyZDEkbHN0TW9kZWxzBVljdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFdpemFyZDEkU3RhcnROYXZpZ2F0aW9uVGVtcGxhdGVDb250YWluZXJJRCRTdGFydE5leHRJbWFnZUJ1dHRvbgVWY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRXaXphcmQxJFN0YXJ0TmF2aWdhdGlvblRlbXBsYXRlQ29udGFpbmVySUQkQ2FuY2VsSW1hZ2VCdXR0b24FX2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkV2l6YXJkMSRGaW5pc2hOYXZpZ2F0aW9uVGVtcGxhdGVDb250YWluZXJJRCRGaW5pc2hQcmV2aW91c0ltYWdlQnV0dG9uBVdjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFdpemFyZDEkRmluaXNoTmF2aWdhdGlvblRlbXBsYXRlQ29udGFpbmVySUQkRmluaXNoSW1hZ2VCdXR0b24FV2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkV2l6YXJkMSRGaW5pc2hOYXZpZ2F0aW9uVGVtcGxhdGVDb250YWluZXJJRCRDYW5jZWxJbWFnZUJ1dHRvbgVbY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRXaXphcmQxJFN0ZXBOYXZpZ2F0aW9uVGVtcGxhdGVDb250YWluZXJJRCRTdGVwUHJldmlvdXNJbWFnZUJ1dHRvbgVXY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRXaXphcmQxJFN0ZXBOYXZpZ2F0aW9uVGVtcGxhdGVDb250YWluZXJJRCRTdGVwTmV4dEltYWdlQnV0dG9uBVVjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFdpemFyZDEkU3RlcE5hdmlnYXRpb25UZW1wbGF0ZUNvbnRhaW5lcklEJENhbmNlbEltYWdlQnV0dG9uBSFjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFdpemFyZDEPEGQUKwACAgFmAgFkBTFjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJFdpemFyZDEkV2l6YXJkTXVsdGlWaWV3Dw9kAgFkBRBjdGwwMCRMb2dpblZpZXcxDw9kAgFk0rD9LEZtwMZOQUkt/37Dh3FPrjc=" />
</div>

<script type="text/javascript">
<!--
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
// -->
</script>


        <div>
            <table width="800" cellpadding="4">
                <tr>
                    <td colspan="1" width="20%" align="center" valign="middle">
                        <img id="ctl00_Image1" src="../../Images/Logos/deadtruck.gif" style="border-width:0px;" /></td>
                    <td colspan="1" width="60%" align="left" valign="middle">
                        <table>
                            <tr>
                                <td align="center">
                                    <span class="scriptxlg">Mike's California Desert Treasures</span><br />
                                    <span class="stencilblkxlg">WANTED DEAD OR ALIVE<br />+1(661)992-1829</span></td>
                                <td>
                                    <img id="ctl00_Image2" src="../../Images/Logos/car9.gif" style="border-width:0px;" /></td>
                            </tr>
                        </table>
                    </td>

                    <td colspan="1" width="20%" align="center" bgcolor="red" valign="middle">
                        <span class="boldlgwhite">Classic Car &amp; Truck Salvage<br />
                            (1920-1975)</span></td>
                </tr>
                <tr>
                    <td width="80%" colspan="2" valign="bottom" align="left" bgcolor="#000000">
                        <span style="color: #ffffff"><strong>
                            <a id="ctl00_HyperLink1" href="../../Default.aspx" style="color:White;font-size:Small;font-weight:bold;">HOME</a>&nbsp; |
                            &nbsp;<a id="ctl00_HyperLink4" href="../Default.aspx" style="color:White;font-size:Small;">ITEMS FOR SALE</a>&nbsp; |&nbsp;<a id="ctl00_HyperLink2" href="../../Admin/Default.aspx" style="color:White;font-size:Small;font-weight:bold;">ADMIN</a></strong></span>
                    </td>
                    <td width="20%" colspan="1" bgcolor="#000000" style="text-align: center">
                       
                                <span style="color: #ffffff">Signed in as:<br />
                                    <span id="ctl00_LoginView1_LoginName1" style="font-weight:bold;">todd.penland</span>
                                    <br />
                                    <a id="ctl00_LoginView1_LoginStatus1" href="javascript:__doPostBack('ctl00$LoginView1$LoginStatus1$ctl00','')" style="color:White;">Sign Out</a>
                                </span>
                           
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="3" valign="top">
                        <strong><span style="font-size: 10pt; color: #ffffff"></span></strong>
                       
    <table cellspacing="0" cellpadding="0" border="0" id="ctl00_ContentPlaceHolder1_Wizard1" style="border-collapse:collapse;">
      <tr>
            <td valign="top" style="color:White;background-color:Red;font-family:verdana;font-size:XX-Small;height:100%;width:100px;"><a href="#ctl00_ContentPlaceHolder1_Wizard1_SkipLink"><img alt="Skip Navigation Links." height="0" width="0" src="/WDOA/WebResource.axd?d=ARwdIPEt2YblQvIo8ya3BQ2&amp;t=632852941105286080" style="border-width:0px;" /></a><table id="ctl00_ContentPlaceHolder1_Wizard1_SideBarContainer_SideBarList" cellspacing="0" border="0" style="border-collapse:collapse;">
                  <tr>
                        <td><a id="ctl00_ContentPlaceHolder1_Wizard1_SideBarContainer_SideBarList_ctl00_SideBarButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Wizard1$SideBarContainer$SideBarList$ctl00$SideBarButton','')" style="color:White;font-size:X-Small;">Item Type</a></td>
                  </tr><tr>
                        <td style="font-weight:bold;"><a id="ctl00_ContentPlaceHolder1_Wizard1_SideBarContainer_SideBarList_ctl01_SideBarButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Wizard1$SideBarContainer$SideBarList$ctl01$SideBarButton','')" style="color:White;font-size:X-Small;">Description</a></td>
                  </tr><tr>
                        <td><a id="ctl00_ContentPlaceHolder1_Wizard1_SideBarContainer_SideBarList_ctl02_SideBarButton" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Wizard1$SideBarContainer$SideBarList$ctl02$SideBarButton','')" style="color:White;font-size:X-Small;">Photos</a></td>
                  </tr>
            </table><a id="ctl00_ContentPlaceHolder1_Wizard1_SkipLink"></a></td><td style="height:100%;"><table cellspacing="0" cellpadding="0" border="0" style="height:100%;width:100%;border-collapse:collapse;">
                  <tr>
                        <td align="center" style="color:White;background-color:Red;font-size:X-Small;font-weight:bold;">Add New Item</td>
                  </tr><tr style="height:100%;">
                        <td style="color:White;">
                <table>
                    <tr>
                        <td>
                            <table>
                                <!--Controls for description of auto parts (contain multi-select Make and Model lists)-->
                                <!--Not visible unless 'Auto Parts' Selected under 'Item Type'-->
                                <tr>
                                    <td>
                                        <span id="ctl00_ContentPlaceHolder1_Wizard1_lblMakesMulti" style="color:Black;">Select Make(s)</span>
                                    </td>
                                    <td>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <select size="4" name="ctl00$ContentPlaceHolder1$Wizard1$lstMakes" multiple="multiple" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$Wizard1$lstMakes\',\'\')', 0)" id="ctl00_ContentPlaceHolder1_Wizard1_lstMakes" style="width:150px;">
                              <option value="8">Alfa Romeo</option>
                              <option value="10">BMW</option>
                              <option value="1">Chevrolet</option>
                              <option value="3">Chrysler</option>
                              <option value="4">Dodge</option>
                              <option value="2">Ford</option>
                              <option value="9">Lamborghini</option>
                              <option value="6">Plymouth</option>
                              <option value="11">Tucker</option>
                              <option value="7">Volkswagen</option>
                              <option value="5">Willy</option>

                        </select>
                                                </td>
                                                <td valign="top">
                                                    <input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$cmdSelectAllMakes" value="Select All" id="ctl00_ContentPlaceHolder1_Wizard1_cmdSelectAllMakes" style="width:100px;" />
                                                    <input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$cmdSelectNoneMakes" value="Select None" id="ctl00_ContentPlaceHolder1_Wizard1_cmdSelectNoneMakes" style="width:100px;" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <span id="ctl00_ContentPlaceHolder1_Wizard1_lblModelsMulti" style="color:Black;">Select Model(s)</span>
                                    </td>
                                    <td>
                                        <table width="100%">
                                            <tr>
                                                <td>
                                                    <select size="4" name="ctl00$ContentPlaceHolder1$Wizard1$lstModels" multiple="multiple" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$Wizard1$lstModels\',\'\')', 0)" id="ctl00_ContentPlaceHolder1_Wizard1_lstModels" style="width:150px;">

                        </select>
                                                </td>
                                                <td valign="top">
                                                    <input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$cmdSelectAllModels" value="Select All" id="ctl00_ContentPlaceHolder1_Wizard1_cmdSelectAllModels" style="width:100px;" />
                                                    <input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$cmdSelectNoneModels" value="Select None" id="ctl00_ContentPlaceHolder1_Wizard1_cmdSelectNoneModels" style="width:100px;" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <!--Controls for description of autos (contain multi-select Make and Model lists)-->
                                <!--Default Selection-->
                                <tr>
                                    <td>
                                        </td>
                                    <td>
                                       
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        </td>
                                    <td>
                                       
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$cmdNewMake" value="New Make" id="ctl00_ContentPlaceHolder1_Wizard1_cmdNewMake" disabled="disabled" />
                                        <input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$cmdNewModel" value="New Model" id="ctl00_ContentPlaceHolder1_Wizard1_cmdNewModel" disabled="disabled" /></td>
                                </tr>
                                <tr>
                                    <td>
                                        <span id="ctl00_ContentPlaceHolder1_Wizard1_lblShortDesc" style="color:Black;">Short Description</span></td>
                                    <td>
                                        <input name="ctl00$ContentPlaceHolder1$Wizard1$txtShortDesc" type="text" id="ctl00_ContentPlaceHolder1_Wizard1_txtShortDesc" style="width:300px;" /></td>
                                </tr>
                                <tr>
                                    <td>
                                        <span id="ctl00_ContentPlaceHolder1_Wizard1_lblDesc" style="color:Black;">Full Description</span></td>
                                    <td>
                                        <textarea name="ctl00$ContentPlaceHolder1$Wizard1$txtDesc" rows="6" cols="20" id="ctl00_ContentPlaceHolder1_Wizard1_txtDesc" style="width:300px;"></textarea></td>
                                </tr>
                                <tr>
                                    <td>
                                        <span id="ctl00_ContentPlaceHolder1_Wizard1_lblPrice" style="color:Black;">Price</span>
                                    </td>
                                    <td>
                                        <font color="black">$<input name="ctl00$ContentPlaceHolder1$Wizard1$txtPrice" type="text" id="ctl00_ContentPlaceHolder1_Wizard1_txtPrice" />
                                            (US Dollars)</font>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <font color="black">Describe the item you wish to sell</font>
                        </td>
                    </tr>
                </table>
            </td>
                  </tr><tr>
                        <td align="right"><table cellspacing="5" cellpadding="5" border="0">
                              <tr>
                                    <td align="right"><input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$StepNavigationTemplateContainerID$StepPreviousButton" value="Previous" id="ctl00_ContentPlaceHolder1_Wizard1_StepNavigationTemplateContainerID_StepPreviousButton" /></td><td align="right"><input type="submit" name="ctl00$ContentPlaceHolder1$Wizard1$StepNavigationTemplateContainerID$StepNextButton" value="Next" id="ctl00_ContentPlaceHolder1_Wizard1_StepNavigationTemplateContainerID_StepNextButton" /></td>
                              </tr>
                        </table></td>
                  </tr>
            </table></td>
      </tr>
</table>
   
<!--NOTES:Changes using the ContentID + $ + lsMakes -->

   

                        &nbsp; &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="3" width="100%" align="center">
                        <hr />
                        <span style="font-size: 8pt">Site Content - Copyright 2006 - Wanted Dead or Alive -
                            All Rights Reserved<br />
                            Web Applications Copyright 2006 - </span><a href="http://www.penland.net" target="_blank">
                                <span style="font-size: 8pt">PENLAND.NET</span></a><span style="font-size: 8pt"> - All
                                    Rights Reserved<br />
                                    <a href="http://www.internetclipart.com" target="_blank">Visit Internet Clipart for
                                        great graphics </a></span>
                    </td>
                </tr>
            </table>
        </div>
   
<div>

      <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWHQKsttCvBgKRuOTfBQKQo8LYAwKXsZvAAwL1uay+CgLBvLKQCALZ05j+BALO09j9BALO05j+BALM05j+BALN05j+BALP05j+BALW05j+BALL05j+BALO09T9BALI05j+BALK05j+BAK12qtTArSOi7gLAtDcjaYOAtWe7psDApHJ2fIMApOLzd0KApuNodMLArmu7IgEAq+XiI8HArzkx58OAuTe/HUCkIbWow9AcntGgXq817jEfeJS2w7f4bg6Fg==" />
</div></form>
</body>
</html>
And here's the error I get when I click a value in lstMakes:

Procedure or Function 'spModelSelectByMake' expects parameter '@MakeID', which was not supplied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Procedure or Function 'spModelSelectByMake' expects parameter '@MakeID', which was not supplied.

Source Error:


Line 103:            .lstModels.DataTextField = "Description"
Line 104:            .lstModels.DataValueField = "ID"
Line 105:            .lstModels.DataBind()
Line 106:        End With
Line 107:    End Sub
 

Source File: C:\Documents and Settings\todd.penland.PENLAND.000\My Documents\Visual Studio 2005\WebSites\WDOA\ForSale\AddItem\Default.aspx.vb    Line: 105

Stack Trace:


[SqlException (0x80131904): Procedure or Function 'spModelSelectByMake' expects parameter '@MakeID', which was not supplied.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +177
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +68
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2305
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
   System.Data.SqlClient.SqlDataReader.get_MetaData() +62
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +294
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +20
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +107
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +10
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1657
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +82
   System.Web.UI.WebControls.ListControl.PerformSelect() +18
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
   ForSale_AddItem_Default.Models_BindData() in C:\Documents and Settings\todd.penland.PENLAND.000\My Documents\Visual Studio 2005\WebSites\WDOA\ForSale\AddItem\Default.aspx.vb:105
   ForSale_AddItem_Default.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\todd.penland.PENLAND.000\My Documents\Visual Studio 2005\WebSites\WDOA\ForSale\AddItem\Default.aspx.vb:74
   System.Web.UI.Control.OnLoad(EventArgs e) +80
   System.Web.UI.Control.LoadRecursive() +49
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3741
ASKER CERTIFIED SOLUTION
Avatar of Sammy
Sammy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Post back after you change to my last post
I think that change will get you working, I hope so

Good luck
PERFECT!  I NEVER would have gotten that on my own.  So, is this a condition that's unique to cascading listboxes?  I'll have to remember this for future reference since I'll probably encounter this situation frequently.

Thanks again!
Ok now we got it, lets make a clean code
try it this way

<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValue"
                Type="Int32" />

clientID is CaSe SeNsItIvE

You welcome and this is the longest post I have ever made on EE LOL
To explain it better is like this
The Parameter statement is looking for the control ID and since you have it in a multi level containers, the framework keeps adding the names starting from the parent container to the control itself by adding the $ sign after each level. and since we only used the control ID by itself the server kept failing to find it since it was residing within layers "Levels" of containers

Hope that explains it for future refrences

Regards


Well, I appreciate you sticking with it.  Just one more question, did you mean for me to copy 'Me.lstMakes.clientID' literally or am I supposed to substitute something for the 'clientID' part?  I'm asking because I got another error when I copied it literally from here into my html.
This:

<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValue" Type="Int32" />

Produced this:

Could not find control '<%= Me.lstMakes.clientID %>' in ControlParameter 'MakeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control '<%= Me.lstMakes.clientID %>' in ControlParameter 'MakeID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: Could not find control '<%= Me.lstMakes.clientID %>' in ControlParameter 'MakeID'.]
   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +565
   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +43
   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +104
   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +42
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +75
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5310

 
literally, Dont change anything in that line of code
"<%= me.lstMakes.clientID %>"
that should pull the full ID produced for the browser, make sure double quotes are there.
what was the error you got?
This:

<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValue" Type="Int32" />

Produced this:

Could not find control '<%= Me.lstMakes.clientID %>' in ControlParameter 'MakeID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Could not find control '<%= Me.lstMakes.clientID %>' in ControlParameter 'MakeID'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[InvalidOperationException: Could not find control '<%= Me.lstMakes.clientID %>' in ControlParameter 'MakeID'.]
   System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +565
   System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +43
   System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +104
   System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +42
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnLoadComplete(EventArgs e) +75
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5310
its reading the quotes and the statement not the clientID like it should be
I am looking into it now
try it with this instead
<asp:ControlParameter ControlID='<%= Me.lstMakes.clientID %>' Name="MakeID" PropertyName="SelectedValue" Type="Int32" />
Nope...it hated that too.  Same error.  I hate to make your longest question ever even longer  :-)
okays try this
<asp:ControlParameter ControlID='<%# Me.lstMakes.UniqueID %>' Name="MakeID" PropertyName="SelectedValue" Type="Int32" />

if that doesnt work I am just gonna have to leave it for another time, since I am half asleep now lol
you can try it with both double quotes and single quotes
Me too...that produced another error but, tell you what...  Tomorrow when I'm awake again, I'll post another question.  This certainly deserves points of its own.  Thanks again for all your help.
you welcome

Good luck