ASP.NET master page vs. SharePoint page layout template - asp.net

A client of mine uses SharePoint to manage its websites, and recently asked me to build a small website for them using ASP.NET, which they would then implement via SharePoint.
My skills with ASP.NET are intermediate, and I have no experience at all with SharePoint.
I created a master page for the site, as well as the individual pages, but the client is telling me that they also need a page layout template in order to view and manage the site via SharePoint.
Unfortunately I have no idea what this means. So, my questions are:
What is the difference between a master page and a page template?
What does this page template look like? In other words, what type of file is it, and what kind of code goes in it?
Thanks in advance for any help you can provide!

The masterpage is what defines the design of your site. It applies for all pages within that site, except for the application pages which are shared by all SharePoint sites in the farm and use a different master page. You can recognize the application pages by looking at the url... it contains /_layouts/ (a virtual directory shared by all SharePoint sites).
When you create a new page in a MOSS site that has the publishing feature enabled, you are asked to specify a page layout. For example: 'Article page with image on right'. Each page layout is bound to one content type, in this example the content type 'Article'. Each content type can have multiple page layouts bound to it. You can have an article with the image on the right, with the image on the left or even without an image.
The content type is what defines the metadata for the page. An article for example, has a title, description, page image, article date,...
The page layouts are stored in the Master Page Gallery. You can create page layouts for existing content types, or you can create a new content type.
Basically, the master page defines how your site looks like, the page layouts define how your pages look like. One way (the easiest way) to create page layouts is to use SharePoint Designer which you can download for free from the Microsoft download pages.
You can find a lot of information about creating page layouts on the web. This may be a good starting point: http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-publishing-page-layout-HA010174128.aspx

Related

Conditional sub menus in _layout.cshml

I am having a play with ASP.NET MVC 5 having used ASP.NET but not MVC before.
I have an entity framework powered set of controllers which return pages with that fall into two broad categories: Devices (DeviceUsage, DeviceErrors, etc.) and Stores (Stores, StoreInstallations, etc.)
I have a _layout.cshml page which lays out a page header which contains the major navigational areas of the website (Stores and Devices). What I would like is the second layer of navigation that shows only the pages within that category, that is, when viewing any of DeviceUsage, DeviceErrors etc, only these options appear in the sub menu.
What is the easiest/best/standard way of doing this?
Create a section so you can add dynamic content there. You may want to use other razor functions like #Html.Action or #Html.RenderAction.
Here is a tutorial for sections if you need.

Including file to separate content and minimize data

I've just started learning ASP.Net but I've come across something that I don't know how it works. Say I have a "main page" that looks the same but depending on what GET value "page" says I should try loading a certain page without changing the main content. I have an index.aspx and whenever I goto index.aspx?page=login, it should try to load login.aspx.
Sure it works, but it writes out the ASP.Net code and not processing it. Not like PHP's include().
What I've tried is: Response.WriteFile() without no luck...
This is because, I have an index.aspx with an runat server id of Content and whatever the page I'm suppose to load is going to go there. So I don't have to recreate every page I make.
Any suggestions?
I think you should look at Master Pages. ASP.NET master pages allow you to create a consistent layout for the pages in your application.
A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application.
You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.
ASP.NET Master Pages - MSDN

Add-ons or libraries for adding user comment functionality to an existing ASP.NET page?

I have an ASP.NET site which I'd like to add page-level comments to without having to change everything over to a blog/CMS platform like BlogEngine.net, Wordpress, Umbraco, etc. Does anyone know of an add-on or library, either free or for-purchase, which can be added to certain ASPX pages to enable a stream of user comments at the end of the page?
The rest of the ASPX page needs to be able to have ASP.NET form controls, jquery and in some cases postback functionality I've written specific to the page which is why a simple blogging page is not enough as it means the blog engine owns the page aside from static content the site owner can enter.
Ideally there would be a way I could add a code snippet or user control to each ASPX page where I wanted comments and then they would show up and be managed independently on each page. I'd like to have the ability for users who post comments to be emailed when additional comments or replies are posted to their comment.
I am currently not locked into a particular authentication method so that is not necessarily a limiting factor.
This seems fun, I've not used it yet so I can't say if it works well or not.
http://developers.facebook.com/news.php?blog=1&story=198

Making a static ASP.NET site which has 100+ pages

I am converting an old html based website to ASP.NET, so that we can include more features like AJAX, Databases later on to the site. Currently my task is to create a new .aspx page for each older html page. To keep the layout persistent i have made a master page.
So currently i am building a content page from the master page, then renaming the content page and adding the text from the html page to the content placeholder area. However i was wondering if can cannot write a system, which can act as a Page Thrower.
Each hyperlink when clicked goes to a serverside code, where it requests the page it wants to load. Typically a webserver expects that the pagelink specified in the hyperlink does exist physically, but here what i am trying to do is that. Say the link is for the page "TravelDetails", the page need not exist physically, but the content of it is present in a file in (html format). so the Page Thrower gathers the data to display for that page, it has a master page already, it adds the html of it there and then throws the custom page. This way i don't have to keep 100+ aspx pages, i can do with a single page and maintain another data structure to store the content (static data) for each page. any guidance if my approach is right, and how to go about it?
Thanks
I think you should try some cms avaialable in market like dotnetnuke. Because every time you need to have to create a web page for a html page. In future if there will be any changes then it will take time. While in cms like dotnetnuke you just need to paste your html in existing system. You don't need to do coding again.
DotNetNuke is a free one. There are other Content Management System also available as well. Another advantage is that dotnetnuke is having skin features. So if you change skin at one place. You need not to do it for all the places.
Take a look at ASP.NET MVC. It uses ASP.NET Routing, which may help you.
Alternatively you can use ASP.NET Routing without MVC, too.
Matthias
Just a thought.
Create a page linked to the Master Page. In the content place holder add a Panel.
Let your Page thrower decide which page to display, retrieve the html data & add it to the panel at runtime.
Why don't you create the pages dynamically and then use asp.net caching in order to increase throughput.

Resources for taking an existing design template and putting it into a masterpage?

I am not a designer, so I took a design template from http://www.opendesigns.org/ and was successful in implementing the design in one page, but when I tried to put it into a masterpage, it came out funny looking, so I was curious if there were any resources/tutorials on taking design templates and putting them in masterpages.
A master page is just HTML / ASP with a placeholder for the content.
As long as everything is well-formed, it should display as normal.
When I am building a master page, I build my design, then copy and paste into the master page and insert the placeholder where I need it.
some of what you say is quite confusing, i think you need to be clearer. A master page is a template for layout on your site or subsite, you would never serve a master page as content, you would always use the master page as a basis for a content page, the master page allows you to define a set of placeholders and, in principle, a global definition of the skeleton of your pages, for the area within which the master page will be used. Its usual to place site wide (or sub site wide - depends what you are doing) content onto the master page itself, things like menus, banners etc. And then let the pages that use the master page define what is held in the content placeholders that will be specific to the page instances.
when you say you put the design in a page, was it pure html ? or was it an aspx ? you arent clear on how you got from
1) design template to "page" (please explain html or aspx)
2) how you took your page and "put it in" your master page (i think if you explain, it might be easier to help)

Resources