0

Results r = (Results)Page.LoadControl("Results.ascx");

In my Page i cannot access USER CONTROL CLASS(Results) Gives error.I cannot resolve.

No namespaces at all.

Even i cannot access other aspx class in same folder's other page also..

Can you please help me.

1 Answer 1

1

ASP.NET compiles pages in batches, and there's no way you can be sure that your currect page is compiled with the Results page. You need to define an interface that you store in App_Code (which all pages are compiled with), implement this interface in your Results page, and use the interface to access whatever you're trying to do.

You could move logic from your Results page into your domain, or into a helper class, instead of keeping it in the view (the page).

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

Comments

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.