Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Gridview Updatecommand ControlParameter Problem

Reply
Thread Tools

Gridview Updatecommand ControlParameter Problem

 
 
Lee Moore
Guest
Posts: n/a
 
      08-18-2005
I have the following code, which I thought should work. I get an error
stating ...

Could not find control 'GOAL_TEXT_CONTROL' in ControlParameter 'GOAL_TEXT'.

Any help would be great.

<-------------------------- Code Snippet --------------------------->

<asp:GridView ID="GridView1" Runat="server"
DataSourceID="SqlDataSource1" DataKeyNames="GOAL_ID"
HeaderStyle-BackColor="#707070"
HeaderStyle-ForeColor="#FFFFFF"
FooterStyle-BackColor="#707070"
FooterStyle-ForeColor="#FFFFFF"
BorderColor="Tan"
CellPadding="2" BackColor="LightGoldenrodYellow"
BorderWidth="1px" ForeColor="Black"
AutoGenerateColumns="False" ShowFooter="True">


<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:TemplateField>
<EditItemTemplate>
<input id="GOAL_ID" type="checkbox" runat="server"
value='<%# Eval("GOAL_ID") %>' />
</EditItemTemplate>

<ItemTemplate>
<input id="GOAL_ID" type="checkbox" runat="server"
value='<%# Eval("GOAL_ID") %>' />
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField>
<HeaderTemplate>
Goal
</HeaderTemplate>
<EditItemTemplate>
<asp:TextBox ID="GOAL_TEXT_CONTROL" Value='<%#
Eval("GOAL_TEXT") %>' Runat="server"></asp:Textbox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="GOAL_TEXT_CONTROL"
Runat="Server"><%# Eval("GOAL_TEXT") %></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox ID="GOAL_TEXT_CONTROL"
Runat="server"></asp:Textbox>
</FooterTemplate>
</asp:TemplateField>

<asp:TemplateField>
<FooterTemplate>
<input id="CYCLE_ID_CONTROL" type=hidden
Value='<%#session("CYCLE_ID")%>' runat="server">
<asp:Button ID="Button1" Runat="server" Text="Add"
OnClick="Button1_Click" />
<asp:Button ID="DeleteSelectedRows"
OnClick="DeleteSelectedRows_Click" runat="server" Text="Del" />
</FooterTemplate>
</asp:TemplateField>

<asp:TemplateField>
<FooterTemplate>
<input id="DEPT_ID_CONTROL" type=hidden
Value='<%#session("DEPT_ID")%>' runat="server">
</FooterTemplate>
</asp:TemplateField>

</Columns>

</asp:GridView>


<asp:SqlDataSource ID="SqlDataSource1" Runat="server"
InsertCommand="INSERT INTO [IEP_GOALS] ([CYCLE_ID], [DEPT_ID],
[GOAL_TEXT]) VALUES (@CYCLE_ID, @DEPT_ID, @GOAL_TEXT)"
SelectCommand="SELECT [GOAL_ID], [CYCLE_ID], [DEPT_ID],
[GOAL_TEXT] FROM [IEP_GOALS]"
DeleteCommand="DELETE FROM [IEP_GOALS] WHERE [GOAL_ID] =
@GOAL_ID"
UpdateCommand="UPDATE [IEP_GOALS] SET [GOAL_TEXT] = @GOAL_TEXT
WHERE GOAL_ID=@GOAL_ID"
ConnectionString="server=sqlserver;user=sa;passwor d=password;database=IEP_DATA;">
<UpdateParameters>
<asp:ControlParameter Name="GOAL_TEXT"
ControlId="GOAL_TEXT_CONTROL" PropertyName="Text"/>
<asp:ControlParameter Name="GOAL_ID" ControlId="GOAL_ID"
PropertyName="Text"/>
</UpdateParameters>

<DeleteParameters>
<asparameter Name="GOAL_ID" Type = "Int32"/>
</DeleteParameters>

<InsertParameters>
<asparameter Type="String"
Name="CYCLE_ID"></asparameter>
<asparameter Type="String" Name="DEPT_ID"></asparameter>
<asparameter Type="String"
Name="GOAL_TEXT"></asparameter>
</InsertParameters>
</asp:SqlDataSource>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
InsertItemTemplate and ControlParameter npei72@gmail.com ASP .Net 2 02-06-2007 08:49 PM
ControlParameter and DataSourceID crossing Content elements Mark ASP .Net 0 07-27-2006 01:16 PM
SqlDataSource ControlParameter from DetailsView dropdownlist K B ASP .Net 3 07-16-2006 09:47 PM
DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand srathin ASP .Net Web Controls 2 04-10-2005 11:07 PM
DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand srathin ASP .Net Datagrid Control 0 04-09-2005 03:05 AM



Advertisments