How to call a user controls method from its parent?

Friday, June 26, 2009

For example the name of your control be a SecureLoginControl and the solution be MyControls and the method you are going to call is SecuredAuthentication(), then the coding you need to do is ,

Control declaration:
Public MyControls.SecureLoginControl objSecureLoginControl ;

When calling:
boolean b;
b=objSecureLoginControl.SecuredAuthentication();

or you can call like this also,

((SecureLoginControl)Panel1.FindControl("objSecureLoginControl")).SecuredAuthentication();

0 comments

Post a Comment

LinkWithin

Blog Widget by LinkWithin

Recommended Books