how can i find usercontrol in Formview

M

mike

Unable to cast object of type 'ASP.gallery_gallerywrite_ascx' to type
'Gallery_GalleryWrite'.


first, error message is like this, Gallery_GalleryWrite is usercontrol that
contained in GalleryList that is another usercontrol
so...in GalleryList class
i'd like to find id of Gallery_GalleryWrite class so i wrote my code like
below.

protected void FormView1_DataBound(object sender, EventArgs e)
{
Gallery_GalleryWrite galleryWrite =
(Gallery_GalleryWrite)FormView1.FindControl("GalleryWrite1");

but it occur some error..

what's problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top