L
Lee Moore
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;password=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>
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;password=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>