J
JohnE
Hello. I have a "unique" situation (thanks to the prior owner of the
project) in a webpage. I have dropdownlist inside an InsertItemTemplate of a
Listview (which is inside a formview's EditItemTemplate). A quick change is
needed which I am hitting a roadblock. I get the following error
Sys.WebForms.PageRequestManagerServerErrorException: Could not find control
'ddlIsChildOfIDInsertEdit' in ControlParameter 'ChangeRequestID'.
Now, before you go 'HUH' and shake your head and roll your eyes, remember,
this was a take over project. It will be changed in time, but not just now.
The Insert is actually an update to only one field. In the sqldatasource it
actually has InsertCommand with and Update in it. The InsertParameter has
the following;
<asp:ControlParameter ControlID="ddlIsChildOfIDInsertEdit"
Name="ChangeRequestID" PropertyName="SelectedValue" Type="Int32" />
If I change the ControlID back to ddlSelectChangeRequest it works like it
should but the information comes from there and not the
ddlIsChildOfIDInsertEdit, which it needs to do now.
I tried putting in some code behind for an item inserting (below) but
doesn't seem it is even needed.
protected void lvwEditChildren_ItemInserting(object sender,
ListViewInsertEventArgs e)
{
DropDownList ddlIsChildOfIDInsertEdit =
(DropDownList)e.Item.FindControl("ddlIsChildOfIDInsertEdit");
if (ddlIsChildOfIDInsertEdit != null)
{
e.Values["IsChildOf"] =
(Convert.ToInt32(ddlIsChildOfIDInsertEdit.SelectedValue));
}
}
Here is the InsertCommand's update statement, which is what is need for the
update to occur (tried it in sql management studio);
InsertCommand="UPDATE tblChangeRequest
SET IsChildOf = ChangeRequestID
WHERE ChangeRequestID = @ChangeRequestID"
Has someone come across this error before and if so what was the fix? Is
there something missing in the above information?
Any help is appreciated.
Thanks....John
project) in a webpage. I have dropdownlist inside an InsertItemTemplate of a
Listview (which is inside a formview's EditItemTemplate). A quick change is
needed which I am hitting a roadblock. I get the following error
Sys.WebForms.PageRequestManagerServerErrorException: Could not find control
'ddlIsChildOfIDInsertEdit' in ControlParameter 'ChangeRequestID'.
Now, before you go 'HUH' and shake your head and roll your eyes, remember,
this was a take over project. It will be changed in time, but not just now.
The Insert is actually an update to only one field. In the sqldatasource it
actually has InsertCommand with and Update in it. The InsertParameter has
the following;
<asp:ControlParameter ControlID="ddlIsChildOfIDInsertEdit"
Name="ChangeRequestID" PropertyName="SelectedValue" Type="Int32" />
If I change the ControlID back to ddlSelectChangeRequest it works like it
should but the information comes from there and not the
ddlIsChildOfIDInsertEdit, which it needs to do now.
I tried putting in some code behind for an item inserting (below) but
doesn't seem it is even needed.
protected void lvwEditChildren_ItemInserting(object sender,
ListViewInsertEventArgs e)
{
DropDownList ddlIsChildOfIDInsertEdit =
(DropDownList)e.Item.FindControl("ddlIsChildOfIDInsertEdit");
if (ddlIsChildOfIDInsertEdit != null)
{
e.Values["IsChildOf"] =
(Convert.ToInt32(ddlIsChildOfIDInsertEdit.SelectedValue));
}
}
Here is the InsertCommand's update statement, which is what is need for the
update to occur (tried it in sql management studio);
InsertCommand="UPDATE tblChangeRequest
SET IsChildOf = ChangeRequestID
WHERE ChangeRequestID = @ChangeRequestID"
Has someone come across this error before and if so what was the fix? Is
there something missing in the above information?
Any help is appreciated.
Thanks....John