|
-
Sep 18th, 2008, 03:14 PM
#10
Thread Starter
Lively Member
Re: Formview's dropdownlist is not being populated after ItemInserted
 Originally Posted by mendhak
My only guess at this point would be that the database isn't returning values.
There's also something else you can do... look at this line:
Dim tmpddl1 As DropDownList = CType(FindControl("fvAutori").FindControl("ddlID_autor"), DropDownList)
fvAutori is a control on the page, inside a placeholder. Do fvAutori.FindControl() or do a placeholderid.findcontrol("fvAutori").FindControl().
Thanks for your reply, mendhak. However, it is not the issue:
1) database not returning values
- it returns values for the first time, and not after the postback (iteminserting)
- it returns values for the similar DDL in gridview; the only difference in code is that it sets selectedvalue for the gridview DDL. (see the comment "' POPULATING DDLIST ddlID_autor" in gvAutori_RowDataBound; compared to the method populate_fvAutori_ddlID_autor)
2) referencing plAutori.FindControl("fvAutori").FindControl...
I tried that before, no success. In fact, I learned that you don't have to reference placeholder at all; Gridview gvAutori is in the same placeholder and I don't have to reference it in a way "plAutori.FindControl("gvAutori")", it works without it.
Take a look at this, this is even more simplified - just a formview with the DDL that should be populated over and over again, after each submission (insertion); I wrote the code in the page content:
http://www.movie-remakes.com/kp/_TES...ATASOURCE.aspx
but I managed to solve it only after I removed the datasource out of the picture:
http://www.movie-remakes.com/kp/_TEST_EN.aspx
But I wouldn't call this "resolved" because I don't understand what's wrong with the 1st solution that includes sqldatasource.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|