473,385 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Gridview Updatecommand ControlParameter Problem

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>
<asp:Parameter Name="GOAL_ID" Type = "Int32"/>
</DeleteParameters>

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

Nov 19 '05 #1
0 1808

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dabbler | last post by:
I have two tables I'm editing in a Gridview. The VANS table contains a key to the other LESSOR table. I would like to use a dropdown list to select the LessorId value while displaying the Lessor...
3
by: Dabbler | last post by:
I have a checkbox control in a GridView EditItemTemplate. My SqlDataAdapter complains when I try and use UpdateCommand Thanks on any binding clarification. GridView: <asp:TemplateField...
2
by: Phuff | last post by:
My Delete and select commands work like a charm, but Update won't work!! Can someone help?? <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"...
3
by: Mike P | last post by:
I must be missing something regarding update parameters. I have tried using <asp:Parameter> to specify my update parameters, and <asp:ControlParameter> when <asp:Parameter> didn't work for a...
1
by: kashif456 | last post by:
I can't figure out why I am getting error updating, deleting and inserting new rows. I am amble to get my dataview populated and also detailview populated: Here's my code: <%@ Page...
0
by: Deepak Palkar | last post by:
Hi I have Gridview and DetailView both on one page. I am showing the list in the Gridview and the particular record in DetailView. the problem is When i EDIT on the DetailView and try to UPDATE...
4
by: =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= | last post by:
I setup a simple gridview as a utility just to do some updates, nothing fancy just wanted easy UI to make updates. When I select ‘Edit’, I get the fields I want to edit. I edit them and click...
0
by: KeesH | last post by:
Hi, I am quite desperate now because I made a nice webshop with a gridview where the customer is able to update the amount of products (Hostas in my situation) or delete the row. The problem is...
2
by: William LaMartin | last post by:
On webform, I am populating a GridView from a SQLDatasource based on a MySQL table named PIB. There is no vb code involved. Everything is done in the source for the aspx page, provided below. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.