0

I have one usercontrol on asp page

<%@ Register Src="UserControls/Show.ascx" TagName="ucShow" TagPrefix="uc1" %>

In that I have one method Show().

I want to access this method from my class file. i.e class1.cs which in app_code

How can I access this method from class.

0

1 Answer 1

1

If you have a user control on page called uc1 then you can use uc1.show() provided it is a public method.

If you want to access it in class1.cs file, you can do something like:

function doSomething(ref UserControlType ctl) {
//do some work
ctl.show();
}

from your aspx.cs you can call method like doSomething(uc1);

Sign up to request clarification or add additional context in comments.

1 Comment

I dont want to access it from codebehind, but want to access it from app_code class.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.