If I have a
using MyProject.language;
literary needs to place on every single page.
My question is, is there a place that I can place the “using” just once, for every page of the project.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since you mentioned page, you can configure ASP.NET to reference the namespace everywhere. This only affect the views themselves and not the code behind
If you use the Razor view engine of ASP.NET MVC, you can add a reference for all views like this
If you are in a plain C# project or in the code behind of a page, you should know that any class that is located in a namespace will automatically reference all object in any parent namespace. Assuming a namespace
Company.Software.Somethings.Data, any classes in theDatanamespace will automatically reference the classes inCompany.Software.SomethingsCompany.SoftwareCompany