Asp.net access method from user control access method
I've a user control registered 开发者_开发问答in an aspx page On click event of a button in the aspx page, how do i call a method which is there in the user control? I need to execute the method in user control on click event of button in aspx page.
Thanks....
// Below might help
UserControl B = new UserControl();
Object[] parameters = new Object[2];
parameters[0] = 45;
parameters[1] = "test";
B = (UserControl)Page.FindControl("[UserControlId]");
B.GetType().GetMethod("[MethodName]").Invoke(B, parameters);
精彩评论