Todd Penland
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.InvalidOperationExc eption: 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. ControlPar ameter.Eva luate(Http Context context, Control control) +382
System.Web.UI.WebControls. Parameter. UpdateValu e(HttpCont ext context, Control control) +70
System.Web.UI.WebControls. ParameterC ollection. UpdateValu es(HttpCon text context, Control control) +135
System.Web.UI.WebControls. SqlDataSou rce.LoadCo mpleteEven tHandler(O bject sender, EventArgs e) +52
System.EventHandler.Invoke (Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadC omplete(Ev entArgs e) +96
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +4087
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
--------------------------
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.InvalidOperationExc
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
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.EventHandler.Invoke
System.Web.UI.Page.OnLoadC
System.Web.UI.Page.Process
--------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
ASKER
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(By Val sender As Object, ByVal e As System.Web.UI.WebControls. WizardNavi gationEven tArgs) 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.Visibl e = False
.cmdSelectAllModels.Visibl e = False
.cmdSelectNoneModels.Visib le = 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.Visibl e = True
.cmdSelectAllModels.Visibl e = True
.cmdSelectNoneModels.Visib le = 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.Visibl e = False
.cmdSelectAllModels.Visibl e = False
.cmdSelectNoneModels.Visib le = 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_SelectedIndexC hanged(ByV al sender As Object, ByVal e As System.EventArgs) Handles lstItemType.SelectedIndexC hanged
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.DataValueFiel d = "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(ByVa l 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.E nabled = True
.cmdCancelUpdateItemType.V isible = True
End If
End With
End Sub
Protected Sub cmdUpdateItemType_Click(By Val 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.Conne ctionStrin gs("LocalS qlServer") .Connectio nString
Dim cnWDOA As New SqlConnection(sConnStr)
Dim cmdMakeUpdate As New SqlCommand("spSaleItemType Update", cnWDOA)
cmdMakeUpdate.CommandType = Data.CommandType.StoredPro cedure
cmdMakeUpdate.Parameters.A dd(New SqlParameter("@SaleItemTyp eID", Data.SqlDbType.Int))
cmdMakeUpdate.Parameters.A dd(New SqlParameter("@SaleItemTyp eDesc", Data.SqlDbType.NVarChar, 50))
cmdMakeUpdate.Parameters(" @SaleItemT ypeID").Va lue = Me.lstItemType.SelectedIte m.Value
cmdMakeUpdate.Parameters(" @SaleItemT ypeDesc"). Value = Me.txtUpdateItemType.Text
cnWDOA.Open()
cmdMakeUpdate.ExecuteNonQu ery()
cnWDOA.Close()
ItemType_BindData()
txtUpdateItemType.Text = ""
With Me
.txtUpdateItemType.Enabled = False
.txtUpdateItemType.Visible = False
.cmdUpdateItemType.Enabled = False
.cmdUpdateItemType.Visible = False
.cmdCancelUpdateItemType.E nabled = False
.cmdCancelUpdateItemType.V isible = False
.lstItemType.Enabled = True
.cmdEditItemType.Enabled = False
.cmdEditItemType.Visible = False
.lblMessageItemType.Text = ""
.lblMessageItemType.Visibl e = 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_Cl ick(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCancelUpdateItemType.Cl ick
With Me
.txtUpdateItemType.Text = ""
.cmdUpdateItemType.Enabled = False
.cmdUpdateItemType.Visible = False
.txtUpdateItemType.Enabled = False
.txtUpdateItemType.Visible = False
.cmdCancelUpdateItemType.E nabled = False
.cmdCancelUpdateItemType.V isible = False
.lstItemType.Enabled = True
.cmdEditItemType.Enabled = True
End With
End Sub
End Class
--------------------------
Imports System.Data
Imports System.Data.SqlClient
Partial Class ForSale_AddItem_Default
Inherits System.Web.UI.Page
Protected Sub Wizard1_NextButtonClick(By
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
.cmdSelectNoneMakes.Visibl
.cmdSelectAllModels.Visibl
.cmdSelectNoneModels.Visib
.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
.cmdSelectNoneMakes.Visibl
.cmdSelectAllModels.Visibl
.cmdSelectNoneModels.Visib
.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
.cmdSelectNoneMakes.Visibl
.cmdSelectAllModels.Visibl
.cmdSelectNoneModels.Visib
.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_SelectedIndexC
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
.lstItemType.DataValueFiel
.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(ByVa
With Me
If .lstItemType.SelectedValue
Else
.lstItemType.Enabled = False
.cmdEditItemType.Enabled = False
.txtUpdateItemType.Enabled
.txtUpdateItemType.Visible
.txtUpdateItemType.Text = .lstItemType.SelectedItem.
.cmdUpdateItemType.Enabled
.cmdUpdateItemType.Visible
.cmdCancelUpdateItemType.E
.cmdCancelUpdateItemType.V
End If
End With
End Sub
Protected Sub cmdUpdateItemType_Click(By
Dim strItemTypeToUpdate As String = Trim(Me.txtUpdateItemType.
If Len(strItemTypeToUpdate) <> 0 Then
Dim sConnStr As String = ConfigurationManager.Conne
Dim cnWDOA As New SqlConnection(sConnStr)
Dim cmdMakeUpdate As New SqlCommand("spSaleItemType
cmdMakeUpdate.CommandType = Data.CommandType.StoredPro
cmdMakeUpdate.Parameters.A
cmdMakeUpdate.Parameters.A
cmdMakeUpdate.Parameters("
cmdMakeUpdate.Parameters("
cnWDOA.Open()
cmdMakeUpdate.ExecuteNonQu
cnWDOA.Close()
ItemType_BindData()
txtUpdateItemType.Text = ""
With Me
.txtUpdateItemType.Enabled
.txtUpdateItemType.Visible
.cmdUpdateItemType.Enabled
.cmdUpdateItemType.Visible
.cmdCancelUpdateItemType.E
.cmdCancelUpdateItemType.V
.lstItemType.Enabled = True
.cmdEditItemType.Enabled = False
.cmdEditItemType.Visible = False
.lblMessageItemType.Text = ""
.lblMessageItemType.Visibl
End With
Else
lblMessageItemType.Text = "Please enter a valid name for the Item Type you are trying to update."
lblMessageItemType.Visible
txtUpdateItemType.Focus()
End If
End Sub
Protected Sub cmdCancelUpdateItemType_Cl
With Me
.txtUpdateItemType.Text = ""
.cmdUpdateItemType.Enabled
.cmdUpdateItemType.Visible
.txtUpdateItemType.Enabled
.txtUpdateItemType.Visible
.cmdCancelUpdateItemType.E
.cmdCancelUpdateItemType.V
.lstItemType.Enabled = True
.cmdEditItemType.Enabled = True
End With
End Sub
End Class
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("Make ID").Defau ltValue = (Wizard1.FindControl("lstM akes")).Se lectedValu e
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-
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("Make
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-
ASKER
Thanks. OK...I immediately got two errors:
Error 1 'Parameters' is not a member of 'System.Web.UI.WebControls .SqlDataSo urce'. CodeBehindFilePath 62 17 ApplicationPath
Error 2 'SelectedValue' is not a member of 'System.Web.UI.Control'. CodeBehindFilePath 62 63 ApplicationPath
Error 1 'Parameters' is not a member of 'System.Web.UI.WebControls
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("lstMa kes") statement.
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("lstMa
Change this line
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="MakeID" PropertyName="SelectedValu e"
Type="Int32" />
to
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="$MakeID" PropertyName="SelectedValu e"
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
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="MakeID" PropertyName="SelectedValu
Type="Int32" />
to
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="$MakeID" PropertyName="SelectedValu
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
ASKER
OK...first I changed it to this:
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="$MakeID" PropertyName="SelectedValu e"
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.InvalidOperationExc eption: 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. ControlPar ameter.Eva luate(Http Context context, Control control) +382
System.Web.UI.WebControls. Parameter. UpdateValu e(HttpCont ext context, Control control) +70
System.Web.UI.WebControls. ParameterC ollection. UpdateValu es(HttpCon text context, Control control) +135
System.Web.UI.WebControls. SqlDataSou rce.LoadCo mpleteEven tHandler(O bject sender, EventArgs e) +52
System.EventHandler.Invoke (Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadC omplete(Ev entArgs e) +96
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +4087
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="$MakeID" PropertyName="SelectedValu
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.InvalidOperationExc
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
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.EventHandler.Invoke
System.Web.UI.Page.OnLoadC
System.Web.UI.Page.Process
--------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
ASKER
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
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
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
give me 2 minutes
ASKER
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="Cont entPlaceHo lder1"
runat="Server">
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" HeaderText="Add New Item"
HeaderStyle-BackColor="Red " HeaderStyle-Font-Bold="Tru e"
HeaderStyle-ForeColor="Whi te" HeaderStyle-Font-Size="X-S mall"
HeaderStyle-HorizontalAlig n="Center" SideBarStyle-VerticalAlign ="Top"
SideBarStyle-BackColor="Re d" SideBarStyle-Font-Size="XX -Small"
SideBarStyle-Font-Names="v erdana" SideBarStyle-ForeColor="Wh ite"
SideBarStyle-Width="100" StepStyle-ForeColor="White " SideBarButtonStyle-Font-Si ze="X-Smal l"
SideBarButtonStyle-ForeCol or="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:Text Box><br />
<asp:Button ID="cmdUpdateItemType" runat="server" Text="Update"
Enabled="False" Visible="False" />
<asp:Button ID="cmdCancelUpdateItemTyp e" 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:Labe l>
</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:Labe l>
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:ListBox ID="lstMakes" runat="server" SelectionMode="Multiple"
Visible="False" AutoPostBack="True" Width="150px"></asp:ListBo x>
</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:Labe l>
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:ListBox ID="lstModels" runat="server" SelectionMode="Multiple"
Visible="False" AutoPostBack="True" Width="150px"></asp:ListBo x>
</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:La bel></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:La bel></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:La bel></td>
<td>
<asp:TextBox ID="txtShortDesc" runat="server" Width="300px"></asp:TextBo x></td>
</tr>
<tr>
<td>
<asp:Label ID="lblDesc" runat="server" Text="Full Description"
ForeColor="Black"></asp:La bel></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:La bel>
</td>
<td>
<font color="black">$<asp:TextBo x ID="txtPrice" runat="server"></asp:TextB ox>
(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:La bel></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:LocalSql Server %>"
ProviderName="System.Data. SqlClient" SelectCommand="spMakesSele ct"
SelectCommandType="StoredP rocedure"> </asp:SqlD ataSource>
<asp:SqlDataSource ID="sdsModels" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSql Server %>"
ProviderName="System.Data. SqlClient" SelectCommand="spModelSele ctByMake"
SelectCommandType="StoredP rocedure">
<SelectParameters>
<!--NOTES:Changes using the ContentID + $ + lsMakes -->
<asp:ControlParameter ControlID="Content1$lstMak es" Name="MakeID" PropertyName="SelectedValu e"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sdsSaleItemTypes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSql Server %>"
ProviderName="System.Data. SqlClient" SelectCommand="spSaleItemT ypesSelect "
SelectCommandType="StoredP rocedure"> </asp:SqlD ataSource>
</asp:Content>
<!--Note: the code adjustment in my comment and if that doesnt work try it with this <asp:ControlParameter ControlID="ContentPlaceHol der1$lstMa kes" Name="MakeID" PropertyName="SelectedValu e"
Type="Int32" />-->
runat="Server">
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" HeaderText="Add New Item"
HeaderStyle-BackColor="Red
HeaderStyle-ForeColor="Whi
HeaderStyle-HorizontalAlig
SideBarStyle-BackColor="Re
SideBarStyle-Font-Names="v
SideBarStyle-Width="100" StepStyle-ForeColor="White
SideBarButtonStyle-ForeCol
<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:Text
<asp:Button ID="cmdUpdateItemType" runat="server" Text="Update"
Enabled="False" Visible="False" />
<asp:Button ID="cmdCancelUpdateItemTyp
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:Labe
</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:Labe
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:ListBox ID="lstMakes" runat="server" SelectionMode="Multiple"
Visible="False" AutoPostBack="True" Width="150px"></asp:ListBo
</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:Labe
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:ListBox ID="lstModels" runat="server" SelectionMode="Multiple"
Visible="False" AutoPostBack="True" Width="150px"></asp:ListBo
</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:La
<td>
<asp:DropDownList ID="cboMake" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblModel" runat="server" Text="Model" ForeColor="Black"></asp:La
<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:La
<td>
<asp:TextBox ID="txtShortDesc" runat="server" Width="300px"></asp:TextBo
</tr>
<tr>
<td>
<asp:Label ID="lblDesc" runat="server" Text="Full Description"
ForeColor="Black"></asp:La
<td>
<asp:TextBox ID="txtDesc" runat="server" Width="300px" Rows="6"
TextMode="MultiLine"></asp
</tr>
<tr>
<td>
<asp:Label ID="lblPrice" runat="server" Text="Price" ForeColor="Black"></asp:La
</td>
<td>
<font color="black">$<asp:TextBo
(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:La
<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:LocalSql
ProviderName="System.Data.
SelectCommandType="StoredP
<asp:SqlDataSource ID="sdsModels" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSql
ProviderName="System.Data.
SelectCommandType="StoredP
<SelectParameters>
<!--NOTES:Changes using the ContentID + $ + lsMakes -->
<asp:ControlParameter ControlID="Content1$lstMak
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sdsSaleItemTypes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSql
ProviderName="System.Data.
SelectCommandType="StoredP
</asp:Content>
<!--Note: the code adjustment in my comment and if that doesnt work try it with this <asp:ControlParameter ControlID="ContentPlaceHol
Type="Int32" />-->
read my last post, try it and let me know
ASKER
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.InvalidOperationExc eption: 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. ControlPar ameter.Eva luate(Http Context context, Control control) +382
System.Web.UI.WebControls. Parameter. UpdateValu e(HttpCont ext context, Control control) +70
System.Web.UI.WebControls. ParameterC ollection. UpdateValu es(HttpCon text context, Control control) +135
System.Web.UI.WebControls. SqlDataSou rce.LoadCo mpleteEven tHandler(O bject sender, EventArgs e) +52
System.EventHandler.Invoke (Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadC omplete(Ev entArgs e) +96
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +4087
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.InvalidOperationExc
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
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.EventHandler.Invoke
System.Web.UI.Page.OnLoadC
System.Web.UI.Page.Process
ASKER
Then when I changed to:
<asp:ControlParameter ControlID="ContentPlaceHol der1$lstMa kes" Name="MakeID" PropertyName="SelectedValu e"
Type="Int32" />
I got this:
Could not find control 'ContentPlaceHolder1$lstMa kes' 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.InvalidOperationExc eption: Could not find control 'ContentPlaceHolder1$lstMa kes' 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$lstMa kes' in ControlParameter 'MakeID'.]
System.Web.UI.WebControls. ControlPar ameter.Eva luate(Http Context context, Control control) +382
System.Web.UI.WebControls. Parameter. UpdateValu e(HttpCont ext context, Control control) +70
System.Web.UI.WebControls. ParameterC ollection. UpdateValu es(HttpCon text context, Control control) +135
System.Web.UI.WebControls. SqlDataSou rce.LoadCo mpleteEven tHandler(O bject sender, EventArgs e) +52
System.EventHandler.Invoke (Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadC omplete(Ev entArgs e) +96
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +4087
<asp:ControlParameter ControlID="ContentPlaceHol
Type="Int32" />
I got this:
Could not find control 'ContentPlaceHolder1$lstMa
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.InvalidOperationExc
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
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.EventHandler.Invoke
System.Web.UI.Page.OnLoadC
System.Web.UI.Page.Process
ASKER
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
ASKER
Comment the whole datasource tag? Or just the parameter?
the parameter only
ASKER
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/Def ault/Style Sheet.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="/wEPDwUJNDQ5OTY3MzA 3D2QWAmYPZ BYCAgMPZBY CAg0PZBYCA gEPZBYCZg9 kFgJmD2QWA gIBD2QWAmY PZBYCAgEPZ BYCZg9kFgJ mD2QWBGYPZ BYEAgEPEA8 WBh4NRGF0Y VRleHRGaWV sZAUTZmxkU 2FsZUl0ZW1 UeXBlRGVzY x4ORGF0YVZ hbHVlRmllb GQFEWZsZFN hbGVJdGVtV HlwZUlEHgt fIURhdGFCb 3VuZGdkEBU EFVByb2plY 3QgQ2FycyA mIFRydWNrc xJDbGFzc2l jIEF1dG8gU GFydHMTUGF ydHMgQ2Fyc yAmIFRydWN rcwVPdGhlc hUEATEBMgE zATQUKwMEZ 2dnZxYBAgF kAgMPDxYEH gdFbmFibGV kZx4HVmlza WJsZWdkZAI BD2QWEAIBD w8WAh8EZ2R kAgMPEA8WC B8ABQtEZXN jcmlwdGlvb h8BBQJJRB8 CZx8EZ2QQF QsKQWxmYSB Sb21lbwNCT VcJQ2hldnJ vbGV0CENoc nlzbGVyBUR vZGdlBEZvc mQLTGFtYm9 yZ2hpbmkIU Gx5bW91dGg GVHVja2VyC lZvbGtzd2F nZW4FV2lsb HkVCwE4AjE wATEBMwE0A TIBOQE2AjE xATcBNRQrA wtnZ2dnZ2d nZ2dnZ2RkA gkPDxYCHwR nZGQCCw8QD xYCHwRnZGR kZAIRDw8WA h8EaGRkAhM PEA8WAh8Ea GRkFgBkAhU PDxYCHwRoZ GQCFw8QDxY CHwRoZGQWA GQYBAUeX19 Db250cm9sc 1JlcXVpcmV Qb3N0QmFja 0tleV9fFgw FI2N0bDAwJ ExvZ2luVml ldzEkTG9na W5TdGF0dXM xJGN0bDAxB SNjdGwwMCR Mb2dpblZpZ XcxJExvZ2l uU3RhdHVzM SRjdGwwMwU qY3RsMDAkQ 29udGVudFB sYWNlSG9sZ GVyMSRXaXp hcmQxJGxzd E1ha2VzBSt jdGwwMCRDb 250ZW50UGx hY2VIb2xkZ XIxJFdpemF yZDEkbHN0T W9kZWxzBVl jdGwwMCRDb 250ZW50UGx hY2VIb2xkZ XIxJFdpemF yZDEkU3Rhc nROYXZpZ2F 0aW9uVGVtc GxhdGVDb25 0YWluZXJJR CRTdGFydE5 leHRJbWFnZ UJ1dHRvbgV WY3RsMDAkQ 29udGVudFB sYWNlSG9sZ GVyMSRXaXp hcmQxJFN0Y XJ0TmF2aWd hdGlvblRlb XBsYXRlQ29 udGFpbmVyS UQkQ2FuY2V sSW1hZ2VCd XR0b24FX2N 0bDAwJENvb nRlbnRQbGF jZUhvbGRlc jEkV2l6YXJ kMSRGaW5pc 2hOYXZpZ2F 0aW9uVGVtc GxhdGVDb25 0YWluZXJJR CRGaW5pc2h QcmV2aW91c 0ltYWdlQnV 0dG9uBVdjd GwwMCRDb25 0ZW50UGxhY 2VIb2xkZXI xJFdpemFyZ DEkRmluaXN oTmF2aWdhd GlvblRlbXB sYXRlQ29ud GFpbmVySUQ kRmluaXNoS W1hZ2VCdXR 0b24FV2N0b DAwJENvbnR lbnRQbGFjZ UhvbGRlcjE kV2l6YXJkM SRGaW5pc2h OYXZpZ2F0a W9uVGVtcGx hdGVDb250Y WluZXJJRCR DYW5jZWxJb WFnZUJ1dHR vbgVbY3RsM DAkQ29udGV udFBsYWNlS G9sZGVyMSR XaXphcmQxJ FN0ZXBOYXZ pZ2F0aW9uV GVtcGxhdGV Db250YWluZ XJJRCRTdGV wUHJldmlvd XNJbWFnZUJ 1dHRvbgVXY 3RsMDAkQ29 udGVudFBsY WNlSG9sZGV yMSRXaXphc mQxJFN0ZXB OYXZpZ2F0a W9uVGVtcGx hdGVDb250Y WluZXJJRCR TdGVwTmV4d EltYWdlQnV 0dG9uBVVjd GwwMCRDb25 0ZW50UGxhY 2VIb2xkZXI xJFdpemFyZ DEkU3RlcE5 hdmlnYXRpb 25UZW1wbGF 0ZUNvbnRha W5lcklEJEN hbmNlbEltY WdlQnV0dG9 uBSFjdGwwM CRDb250ZW5 0UGxhY2VIb 2xkZXIxJFd pemFyZDEPE GQUKwACAgF mAgFkBTFjd GwwMCRDb25 0ZW50UGxhY 2VIb2xkZXI xJFdpemFyZ DEkV2l6YXJ kTXVsdGlWa WV3Dw9kAgF kBRBjdGwwM CRMb2dpblZ pZXcxDw9kA gFk0rD9LEZ twMZOQUkt/ 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.valu e = eventTarget;
theForm.__EVENTARGUMENT.va lue = 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/de adtruck.gi f" 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">WANT ED DEAD OR ALIVE<br />+1(661)992-1829</span></ td>
<td>
<img id="ctl00_Image2" src="../../Images/Logos/ca r9.gif" style="border-width:0px;" /></td>
</tr>
</table>
</td>
<td colspan="1" width="20%" align="center" bgcolor="red" valign="middle">
<span class="boldlgwhite">Classi c Car & 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-si ze:Small;f ont-weight :bold;">HO ME</a>&nbs p; |
<a id="ctl00_HyperLink4" href="../Default.aspx" style="color:White;font-si ze:Small;" >ITEMS FOR SALE</a> | <a id="ctl00_HyperLink2" href="../../Admin/Default. aspx" style="color:White;font-si ze:Small;f ont-weight :bold;">AD MIN</a></s trong></sp an>
</td>
<td width="20%" colspan="1" bgcolor="#000000" style="text-align: center">
<span style="color: #ffffff">Signed in as:<br />
<span id="ctl00_LoginView1_Login Name1" style="font-weight:bold;"> todd.penla nd</span>
<br />
<a id="ctl00_LoginView1_Login Status1" href="javascript:__doPostB ack('ctl00 $LoginView 1$LoginSta tus1$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_ContentPlaceHold er1_Wizard 1" style="border-collapse:col lapse;">
<tr>
<td valign="top" style="color:White;backgro und-color: Red;font-f amily:verd ana;font-s ize:XX-Sma ll;height: 100%;width :100px;">< a href="#ctl00_ContentPlaceH older1_Wiz ard1_SkipL ink"><img alt="Skip Navigation Links." height="0" width="0" src="/WDOA/WebResource.axd ?d=ARwdIPE t2YblQvIo8 ya3BQ2& ;t=6328529 4110528608 0" style="border-width:0px;" /></a><table id="ctl00_ContentPlaceHold er1_Wizard 1_SideBarC ontainer_S ideBarList " cellspacing="0" border="0" style="border-collapse:col lapse;">
<tr>
<td><a id="ctl00_ContentPlaceHold er1_Wizard 1_SideBarC ontainer_S ideBarList _ctl00_Sid eBarButton " href="javascript:__doPostB ack('ctl00 $ContentPl aceHolder1 $Wizard1$S ideBarCont ainer$Side BarList$ct l00$SideBa rButton',' ')" style="color:White;font-si ze:X-Small ;">Item Type</a></td>
</tr><tr>
<td style="font-weight:bold;"> <a id="ctl00_ContentPlaceHold er1_Wizard 1_SideBarC ontainer_S ideBarList _ctl01_Sid eBarButton " href="javascript:__doPostB ack('ctl00 $ContentPl aceHolder1 $Wizard1$S ideBarCont ainer$Side BarList$ct l01$SideBa rButton',' ')" style="color:White;font-si ze:X-Small ;">Descrip tion</a></ td>
</tr><tr>
<td><a id="ctl00_ContentPlaceHold er1_Wizard 1_SideBarC ontainer_S ideBarList _ctl02_Sid eBarButton " href="javascript:__doPostB ack('ctl00 $ContentPl aceHolder1 $Wizard1$S ideBarCont ainer$Side BarList$ct l02$SideBa rButton',' ')" style="color:White;font-si ze:X-Small ;">Photos< /a></td>
</tr>
</table><a id="ctl00_ContentPlaceHold er1_Wizard 1_SkipLink "></a></td ><td style="height:100%;"><tabl e cellspacing="0" cellpadding="0" border="0" style="height:100%;width:1 00%;border -collapse: collapse;" >
<tr>
<td align="center" style="color:White;backgro und-color: Red;font-s ize:X-Smal l;font-wei ght: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_ContentPlaceHold er1_Wizard 1_lblMakes Multi" style="color:Black;">Selec t Make(s)</span>
</td>
<td>
<table width="100%">
<tr>
<td>
<select size="4" name="ctl00$ContentPlaceHo lder1$Wiza rd1$lstMak es" multiple="multiple" onchange="javascript:setTi meout('__d oPostBack( \'ctl00$Co ntentPlace Holder1$Wi zard1$lstM akes\',\'\ ')', 0)" id="ctl00_ContentPlaceHold er1_Wizard 1_lstMakes " style="width:150px;">
<option value="8">Alfa Romeo</option>
<option value="10">BMW</option>
<option value="1">Chevrolet</optio n>
<option value="3">Chrysler</option >
<option value="4">Dodge</option>
<option value="2">Ford</option>
<option value="9">Lamborghini</opt ion>
<option value="6">Plymouth</option >
<option value="11">Tucker</option>
<option value="7">Volkswagen</opti on>
<option value="5">Willy</option>
</select>
</td>
<td valign="top">
<input type="submit" name="ctl00$ContentPlaceHo lder1$Wiza rd1$cmdSel ectAllMake s" value="Select All" id="ctl00_ContentPlaceHold er1_Wizard 1_cmdSelec tAllMakes" style="width:100px;" />
<input type="submit" name="ctl00$ContentPlaceHo lder1$Wiza rd1$cmdSel ectNoneMak es" value="Select None" id="ctl00_ContentPlaceHold er1_Wizard 1_cmdSelec tNoneMakes " style="width:100px;" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold er1_Wizard 1_lblModel sMulti" style="color:Black;">Selec t Model(s)</span>
</td>
<td>
<table width="100%">
<tr>
<td>
<select size="4" name="ctl00$ContentPlaceHo lder1$Wiza rd1$lstMod els" multiple="multiple" onchange="javascript:setTi meout('__d oPostBack( \'ctl00$Co ntentPlace Holder1$Wi zard1$lstM odels\',\' \')', 0)" id="ctl00_ContentPlaceHold er1_Wizard 1_lstModel s" style="width:150px;">
</select>
</td>
<td valign="top">
<input type="submit" name="ctl00$ContentPlaceHo lder1$Wiza rd1$cmdSel ectAllMode ls" value="Select All" id="ctl00_ContentPlaceHold er1_Wizard 1_cmdSelec tAllModels " style="width:100px;" />
<input type="submit" name="ctl00$ContentPlaceHo lder1$Wiza rd1$cmdSel ectNoneMod els" value="Select None" id="ctl00_ContentPlaceHold er1_Wizard 1_cmdSelec tNoneModel s" 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$ContentPlaceHo lder1$Wiza rd1$cmdNew Make" value="New Make" id="ctl00_ContentPlaceHold er1_Wizard 1_cmdNewMa ke" disabled="disabled" />
<input type="submit" name="ctl00$ContentPlaceHo lder1$Wiza rd1$cmdNew Model" value="New Model" id="ctl00_ContentPlaceHold er1_Wizard 1_cmdNewMo del" disabled="disabled" /></td>
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold er1_Wizard 1_lblShort Desc" style="color:Black;">Short Description</span></td>
<td>
<input name="ctl00$ContentPlaceHo lder1$Wiza rd1$txtSho rtDesc" type="text" id="ctl00_ContentPlaceHold er1_Wizard 1_txtShort Desc" style="width:300px;" /></td>
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold er1_Wizard 1_lblDesc" style="color:Black;">Full Description</span></td>
<td>
<textarea name="ctl00$ContentPlaceHo lder1$Wiza rd1$txtDes c" rows="6" cols="20" id="ctl00_ContentPlaceHold er1_Wizard 1_txtDesc" style="width:300px;"></tex tarea></td >
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold er1_Wizard 1_lblPrice " style="color:Black;">Price </span>
</td>
<td>
<font color="black">$<input name="ctl00$ContentPlaceHo lder1$Wiza rd1$txtPri ce" type="text" id="ctl00_ContentPlaceHold er1_Wizard 1_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$ContentPlaceHo lder1$Wiza rd1$StepNa vigationTe mplateCont ainerID$St epPrevious Button" value="Previous" id="ctl00_ContentPlaceHold er1_Wizard 1_StepNavi gationTemp lateContai nerID_Step PreviousBu tton" /></td><td align="right"><input type="submit" name="ctl00$ContentPlaceHo lder1$Wiza rd1$StepNa vigationTe mplateCont ainerID$St epNextButt on" value="Next" id="ctl00_ContentPlaceHold er1_Wizard 1_StepNavi gationTemp lateContai nerID_Step NextButton " /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!--NOTES:Changes using the ContentID + $ + lsMakes -->
</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="/wEWHQKsttCvBgKRuOT fBQKQo8LYA wKXsZvAAwL 1uay+CgLBv LKQCALZ05j +BALO09j9B ALO05j+BAL M05j+BALN0 5j+BALP05j +BALW05j+B ALL05j+BAL O09T9BALI0 5j+BALK05j +BAK12qtTA rSOi7gLAtD cjaYOAtWe7 psDApHJ2fI MApOLzd0KA puNodMLArm u7IgEAq+Xi I8HArzkx58 OAuTe/HUCk IbWow9Acnt GgXq817jEf eJS2w7f4bg 6Fg==" />
</div></form>
</body>
</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/Def
<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="/wEPDwUJNDQ5OTY3MzA
</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.valu
theForm.__EVENTARGUMENT.va
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/de
<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">WANT
<td>
<img id="ctl00_Image2" src="../../Images/Logos/ca
</tr>
</table>
</td>
<td colspan="1" width="20%" align="center" bgcolor="red" valign="middle">
<span class="boldlgwhite">Classi
(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-si
<a id="ctl00_HyperLink4" href="../Default.aspx" style="color:White;font-si
</td>
<td width="20%" colspan="1" bgcolor="#000000" style="text-align: center">
<span style="color: #ffffff">Signed in as:<br />
<span id="ctl00_LoginView1_Login
<br />
<a id="ctl00_LoginView1_Login
</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_ContentPlaceHold
<tr>
<td valign="top" style="color:White;backgro
<tr>
<td><a id="ctl00_ContentPlaceHold
</tr><tr>
<td style="font-weight:bold;">
</tr><tr>
<td><a id="ctl00_ContentPlaceHold
</tr>
</table><a id="ctl00_ContentPlaceHold
<tr>
<td align="center" style="color:White;backgro
</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_ContentPlaceHold
</td>
<td>
<table width="100%">
<tr>
<td>
<select size="4" name="ctl00$ContentPlaceHo
<option value="8">Alfa Romeo</option>
<option value="10">BMW</option>
<option value="1">Chevrolet</optio
<option value="3">Chrysler</option
<option value="4">Dodge</option>
<option value="2">Ford</option>
<option value="9">Lamborghini</opt
<option value="6">Plymouth</option
<option value="11">Tucker</option>
<option value="7">Volkswagen</opti
<option value="5">Willy</option>
</select>
</td>
<td valign="top">
<input type="submit" name="ctl00$ContentPlaceHo
<input type="submit" name="ctl00$ContentPlaceHo
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold
</td>
<td>
<table width="100%">
<tr>
<td>
<select size="4" name="ctl00$ContentPlaceHo
</select>
</td>
<td valign="top">
<input type="submit" name="ctl00$ContentPlaceHo
<input type="submit" name="ctl00$ContentPlaceHo
</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$ContentPlaceHo
<input type="submit" name="ctl00$ContentPlaceHo
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold
<td>
<input name="ctl00$ContentPlaceHo
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold
<td>
<textarea name="ctl00$ContentPlaceHo
</tr>
<tr>
<td>
<span id="ctl00_ContentPlaceHold
</td>
<td>
<font color="black">$<input name="ctl00$ContentPlaceHo
(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$ContentPlaceHo
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!--NOTES:Changes using the ContentID + $ + lsMakes -->
</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
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="/wEWHQKsttCvBgKRuOT
</div></form>
</body>
</html>
ASKER
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.SqlE xception: 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.PENL AND.000\My Documents\Visual Studio 2005\WebSites\WDOA\ForSale \AddItem\D efault.asp x.vb Line: 105
Stack Trace:
[SqlException (0x80131904): Procedure or Function 'spModelSelectByMake' expects parameter '@MakeID', which was not supplied.]
System.Data.SqlClient.SqlC onnection. OnError(Sq lException exception, Boolean breakConnection) +177
System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection) +68
System.Data.SqlClient.TdsP arser.Thro wException AndWarning (TdsParser StateObjec t stateObj) +199
System.Data.SqlClient.TdsP arser.Run( RunBehavio r runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2305
System.Data.SqlClient.SqlD ataReader. ConsumeMet aData() +31
System.Data.SqlClient.SqlD ataReader. get_MetaDa ta() +62
System.Data.SqlClient.SqlC ommand.Fin ishExecute Reader(Sql DataReader ds, RunBehavior runBehavior, String resetOptionsString) +294
System.Data.SqlClient.SqlC ommand.Run ExecuteRea derTds(Com mandBehavi or cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1021
System.Data.SqlClient.SqlC ommand.Run ExecuteRea der(Comman dBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314
System.Data.SqlClient.SqlC ommand.Run ExecuteRea der(Comman dBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +20
System.Data.SqlClient.SqlC ommand.Exe cuteReader (CommandBe havior behavior, String method) +107
System.Data.SqlClient.SqlC ommand.Exe cuteDbData Reader(Com mandBehavi or behavior) +10
System.Data.Common.DbComma nd.System. Data.IDbCo mmand.Exec uteReader( CommandBeh avior behavior) +7
System.Data.Common.DbDataA dapter.Fil lInternal( DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataA dapter.Fil l(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +139
System.Data.Common.DbDataA dapter.Fil l(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls. SqlDataSou rceView.Ex ecuteSelec t(DataSour ceSelectAr guments arguments) +1657
System.Web.UI.WebControls. ListContro l.OnDataBi nding(Even tArgs e) +82
System.Web.UI.WebControls. ListContro l.PerformS elect() +18
System.Web.UI.WebControls. BaseDataBo undControl .DataBind( ) +68
ForSale_AddItem_Default.Mo dels_BindD ata() in C:\Documents and Settings\todd.penland.PENL AND.000\My Documents\Visual Studio 2005\WebSites\WDOA\ForSale \AddItem\D efault.asp x.vb:105
ForSale_AddItem_Default.Pa ge_Load(Ob ject sender, EventArgs e) in C:\Documents and Settings\todd.penland.PENL AND.000\My Documents\Visual Studio 2005\WebSites\WDOA\ForSale \AddItem\D efault.asp x.vb:74
System.Web.UI.Control.OnLo ad(EventAr gs e) +80
System.Web.UI.Control.Load Recursive( ) +49
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +3741
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.SqlE
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.PENL
Stack Trace:
[SqlException (0x80131904): Procedure or Function 'spModelSelectByMake' expects parameter '@MakeID', which was not supplied.]
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlI
System.Data.SqlClient.TdsP
System.Data.SqlClient.TdsP
System.Data.SqlClient.SqlD
System.Data.SqlClient.SqlD
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.SqlClient.SqlC
System.Data.Common.DbComma
System.Data.Common.DbDataA
System.Data.Common.DbDataA
System.Data.Common.DbDataA
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
ForSale_AddItem_Default.Mo
ForSale_AddItem_Default.Pa
System.Web.UI.Control.OnLo
System.Web.UI.Control.Load
System.Web.UI.Page.Process
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Post back after you change to my last post
I think that change will get you working, I hope so
Good luck
I think that change will get you working, I hope so
Good luck
ASKER
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!
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="SelectedValu e"
Type="Int32" />
clientID is CaSe SeNsItIvE
You welcome and this is the longest post I have ever made on EE LOL
try it this way
<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValu
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
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
ASKER
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.
ASKER
This:
<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValu e" 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.InvalidOperationExc eption: 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. ControlPar ameter.Eva luate(Http Context context, Control control) +565
System.Web.UI.WebControls. Parameter. UpdateValu e(HttpCont ext context, Control control) +43
System.Web.UI.WebControls. ParameterC ollection. UpdateValu es(HttpCon text context, Control control) +104
System.Web.UI.WebControls. SqlDataSou rce.LoadCo mpleteEven tHandler(O bject sender, EventArgs e) +42
System.EventHandler.Invoke (Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadC omplete(Ev entArgs e) +75
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5310
<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValu
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.InvalidOperationExc
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
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.EventHandler.Invoke
System.Web.UI.Page.OnLoadC
System.Web.UI.Page.Process
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?
"<%= 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?
ASKER
This:
<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValu e" 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.InvalidOperationExc eption: 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. ControlPar ameter.Eva luate(Http Context context, Control control) +565
System.Web.UI.WebControls. Parameter. UpdateValu e(HttpCont ext context, Control control) +43
System.Web.UI.WebControls. ParameterC ollection. UpdateValu es(HttpCon text context, Control control) +104
System.Web.UI.WebControls. SqlDataSou rce.LoadCo mpleteEven tHandler(O bject sender, EventArgs e) +42
System.EventHandler.Invoke (Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadC omplete(Ev entArgs e) +75
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +5310
<asp:ControlParameter ControlID="<%= Me.lstMakes.clientID %>" Name="MakeID" PropertyName="SelectedValu
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.InvalidOperationExc
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
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.EventHandler.Invoke
System.Web.UI.Page.OnLoadC
System.Web.UI.Page.Process
its reading the quotes and the statement not the clientID like it should be
I am looking into it now
I am looking into it now
try it with this instead
<asp:ControlParameter ControlID='<%= Me.lstMakes.clientID %>' Name="MakeID" PropertyName="SelectedValu e" Type="Int32" />
<asp:ControlParameter ControlID='<%= Me.lstMakes.clientID %>' Name="MakeID" PropertyName="SelectedValu
ASKER
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="SelectedValu e" Type="Int32" />
if that doesnt work I am just gonna have to leave it for another time, since I am half asleep now lol
<asp:ControlParameter ControlID='<%# Me.lstMakes.UniqueID %>' Name="MakeID" PropertyName="SelectedValu
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
ASKER
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
Good luck
ASKER
--------------------------
<%@ Page Language="VB" MasterPageFile="~/MasterPa
CodeFile="Default.aspx.vb"
Title="Add Items For Sale" Debug="true"%>
<asp:Content ID="Content1" ContentPlaceHolderID="Cont
runat="Server">
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" HeaderText="Add New Item"
HeaderStyle-BackColor="Red
HeaderStyle-ForeColor="Whi
HeaderStyle-HorizontalAlig
SideBarStyle-BackColor="Re
SideBarStyle-Font-Names="v
SideBarStyle-Width="100" StepStyle-ForeColor="White
SideBarButtonStyle-ForeCol
<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:Text
<asp:Button ID="cmdUpdateItemType" runat="server" Text="Update"
Enabled="False" Visible="False" />
<asp:Button ID="cmdCancelUpdateItemTyp
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:Labe
</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:Labe
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:ListBox ID="lstMakes" runat="server" SelectionMode="Multiple"
Visible="False" AutoPostBack="True" Width="150px"></asp:ListBo
</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:Labe
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:ListBox ID="lstModels" runat="server" SelectionMode="Multiple"
Visible="False" AutoPostBack="True" Width="150px"></asp:ListBo
</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:La
<td>
<asp:DropDownList ID="cboMake" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblModel" runat="server" Text="Model" ForeColor="Black"></asp:La
<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:La
<td>
<asp:TextBox ID="txtShortDesc" runat="server" Width="300px"></asp:TextBo
</tr>
<tr>
<td>
<asp:Label ID="lblDesc" runat="server" Text="Full Description"
ForeColor="Black"></asp:La
<td>
<asp:TextBox ID="txtDesc" runat="server" Width="300px" Rows="6"
TextMode="MultiLine"></asp
</tr>
<tr>
<td>
<asp:Label ID="lblPrice" runat="server" Text="Price" ForeColor="Black"></asp:La
</td>
<td>
<font color="black">$<asp:TextBo
(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:La
<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:LocalSql
ProviderName="System.Data.
SelectCommandType="StoredP
<asp:SqlDataSource ID="sdsModels" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSql
ProviderName="System.Data.
SelectCommandType="StoredP
<SelectParameters>
<asp:ControlParameter ControlID="lstMakes" Name="MakeID" PropertyName="SelectedValu
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="sdsSaleItemTypes" runat="server" ConnectionString="<%$ ConnectionStrings:LocalSql
ProviderName="System.Data.
SelectCommandType="StoredP
</asp:Content>