"Alexey Smirnov" wrote:
> On May 31, 5:12 pm, JohnE <Jo...@discussions.microsoft.com> wrote:
> > "Alexey Smirnov" wrote:
> > > On May 31, 6:32 am, JohnE <Jo...@discussions.microsoft.com> wrote:
> > > > 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.PageRequestManagerServerErrorExceptio n: 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("ddlIsChildOfIDIn sertEdit");
> >
> > > > if (ddlIsChildOfIDInsertEdit != null)
> > > > {
> > > > e.Values["IsChildOf"] =
> > > > (Convert.ToInt32(ddlIsChildOfIDInsertEdit.Selected Value));
> > > > }
> > > > }
> >
> > > > 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
> >
> > > Hi John
> >
> > > Please check if this could help you
> > >http://geekswithblogs.net/azamsharp/.../27/89475.aspx
> > > .
> >
> > Thanks for the reply. Unfortunately, the view source was not complete and
> > did not show what was in the formview. I opened up another page to view
> > source and got what was being done so I tried it for the ddl to be seen.
> > Didn't work. Still getting the same error. Maybe its time to convert it to
> > an actual update command, etc. Time to start googling again unless you have
> > other thoughts.
> > Thanks.
> > John
>
> I think you can try to enable tracing to see where your controls are.
>
> Use
>
> <%@ Page Trace="true"...
>
> or
>
> How to: Enable Tracing for an ASP.NET Application
> http://msdn.microsoft.com/en-us/library/0x5wc973.aspx
> .
>
Well, okay. I think it might be closer. I took out the control parameter
line and put in the following;
<asp

arameter Direction="Input" Name="ChangeRequestID" Type="Int32" />
No errors occurred, but, nothing was entered into the field either. The
droplist item was selected, the linkbutton (Insert) was clicked, and the
droplist returned to the empty line. All the others on the same page have
the same action. So, at least half there.
On the code behind in the ItemInserting (original post) hovering over the
selectedvalue shows the value that is needed.
Thoughts?