asp.net - Can't get access to page class from control -


itemprop = "text">

I have created a new web site project Some helpful categories are in the App_Code folder The page is in the root User Control Root folder in UserControls All page squares are defined in the MyProjectName.Pages namespace. All user control classes are defined in the MyProjectName.UserControls namespace.

I can access controls from my pages, but I can not access page classes with my own controls! I use the page property and try to put it in the mpage class (directives using micronsnonym. Page in the beginning). Here the compiler says, there is no type or namespace page in the MyProjectName namespace. In addition, I do not see these namespaces (MyPoCigen.Pages and MiproSnnam.User Controls) in the Object Viewer. Should I take control of my control and pages anywhere in order to gain the ability to use Page Classes in control?

Your best bet is to switch from a web site to a web project.

The website "Project" is a Microsoft Foster child introduced in ASP.Net 2.0, with the intention of being able to dynamically compile pages after the deployment of this site. So when compiled, then that compiler should be prepared for the situation when it was made (including introduction of introductory and / or namespaces) in the Microsoft solution episode of this problem was to separate classes from pages to some extent - They are compiled in separate passes.

Initially, it was the only model for web applications in ASP.NET 2.0, but so many problems started by it (you just have one of them) that MS re-models the ASP.NET 1.1 Introduced, which is now called Web Projects. There is no limit to this in this model, but it is more difficult to dynamically deploy the APX.

The bottom line is that unless you really are able to change the ASPX on the fly, you are better off the web project. And if you do, then you have to keep an eye out for the design of your web site


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -