Hi all,

I have such a piece of code:

class MyControl : UserControl
{
   .........
}


class MyPage : Page
{
    private void Page_Load(...)
    {
       MyControl control = ( MyControl ) LoadControl( "mycontrol.ascx" );
    }
}


At line MyControl control = ( MyControl ) LoadControl( "mycontrol.ascx" );

I get an error "Cannot cast from source type to destination type"
I refered to MSDN - such a conversion is correct (they got a simulair
sample to the code above), any suggestion?


Slava.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to