Link to home
Start Free TrialLog in
Avatar of Simon Cripps
Simon CrippsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Could not find control 'xxx' in ControlParameter 'yyy'.

Hi,
I'm trying to updat a SQL datasoure using a control parameter and am getting the message
"Could not find control 'form1$Content2$DataList1$name' in ControlParameter 'AWCname'."
The code is attached below I have include the $ to try and identify the correct object (which is contained in a page within master page) but this does not appear to work. Any suggestions as to the issue.
Kind regards

<EditItemTemplate>
                 AWCname:
                <asp:Label ID="AWCnameLabel" runat="server" Text='<%# Eval("AWCname") %>' />
                <br />
                <asp:textbox id="name" runat="server"
               text='<%# ( ( DataRowView ) Container.DataItem ) [ "AWCname" ] %>' />
<br />
                <asp:linkbutton ID="Linkbutton2" commandname="update" runat="server" text="Update" />
               <asp:linkbutton ID="Linkbutton3" commandname="cancel" runat="server" text="Cancel" />
</EditItemTemplate>


#########Then further down the code fro SqlDataSource2 is...###############

UpdateCommand="UPDATE AWCampaign SET AWCname = @AWCname WHERE (AWCCampaignID = @AWCCampaignID)">
        <UpdateParameters>
              <asp:ControlParameter ControlID="form1$Content2$DataList1$name" Name="AWCname" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="lblGetCampaign" Name="AWCCampaignID" PropertyName="Text" Type="Int32" />
        </UpdateParameters>

##############  on the source code is ############

 public void myListUpdateHandler(Object src, DataListCommandEventArgs e)

SqlDataSource2.Update();

Open in new window

Avatar of Kumaraswamy R
Kumaraswamy R
Flag of India image

ASKER CERTIFIED SOLUTION
Avatar of Simon Cripps
Simon Cripps
Flag of United Kingdom of Great Britain and Northern Ireland 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