0

I am new to .NET. How i can use include files for my menus? I am used to do with php is I make one php file with menu and I include it in all PHP files so that it can be changed in all pages when I would change it basic file. I dont know what is the concept of it in .NET?

1 Answer 1

1

In ASP.NET, there is the concept of Master Pages that can be used to include commonly required files. Master pages can be nested, meaning that a Master Page can be derived from another master page, thereby allowing you to compose a page from multiple "pages/files". Inside of a Page template, you specify the Master Page file to use, inside of the Page Directive.

If you're just starting out in .NET web applications, may I suggest taking a look at ASP.NET MVC and the Razor View Engine, a more terse and cleaner syntax for generating HTML. Razor has a similar concept to Master Pages, but they are known as Layouts and these can also be nested.

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

2 Comments

how to use config file which we usually use for predefined variables etc username and password?
There are many ways to do this, one of which could be inheritance - in ASP.NET web forms, create a base Page class from which you derive your pages; in ASP.NET MVC, create a base controller from which you derive your controllers.

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.