Difference between site.master main.master - asp.net

What is the Difference between site.master vs main.master.

The only difference is the name.
Both are master pages - one is called site the other main. You can have more than one master page in a site - different content pages can use different master pages.

Related

Can't see Site.Master

I'm learning ASP.NET from a book and there's a page about creating a web form with master page. On the picture in a book, at the 'Select Master Page' window there are two options (Site.Master & Site.Mobile.Master), but I can't see either of those. I'm using the same version of Visual Studio (Community 2015)
Any ideas?
Thanks
First you have to create a master page as site1.master then only you have to add content pages under that master
You can create any number of master pages

Add css template in other than index.html(masterpage) in asp.net

I attached a css template to the masterpage in my asp.net website. Now I need to create another blank page and link it to the masterpage(index.html)i.e Default.aspx. In the newly created web form how to attach the same css template. please help???????
if you link same master page to another blank page say - Default.aspx then it will automatically use css apply in master page
read master page related tutorial here
http://www.asp.net/web-forms/tutorials/master-pages

two different webform pages share top content

I have a drupal page with two seperate webform contents. Now if i want to add content on top of the actual form, it is mistakedly share across both pages, why is that and how can i keep the content seteprate?
Just recreated one of the Webform pages and this time things kept sepparately - weird...

Master Page Loading Multiple Pages

I'm developing a web site that has a master page that consists of 4 different pages that will load simultaneously (using ContentPlaceHolder).
However, when I test the website on my local machine, only one page renders at a time (depending on the URL I type in).
Is there any way that on Page Load, to tell the master (or maybe the browser?) to load all 4 pages instead of only the page that was directly requested from the browser?
A master page doesn't work like a frameset that you display other pages in, you only display a single page using the frameset.
You can have several content placeholders in the master page, but all content still comes from the same page.
If you want to have the content in separate files, you should create user controls that you can include in a page.
It sounds like you should be using iframes. Context place holders are designed so that a single page can display its content against a common theme or background - the master page.
You can have multiple context place holders but they ALL must be populated by the page being loaded. For instance, 1 master page could have a place holder for a menu and another for the content and a third for a news feed sidebar, but the aspx page using the master page has to define the content of all 3 place holders.
Maybe I'm not understanding, but add another page selecting "Web Form using Master Page" from the Add New Item dialog and then on the next window select your master page. Try navigating to the page you just added.
I think you're misunderstanding master pages, the master page does not load anything. The master page defines some common layout (and possibly code), and then you create child pages which only need to supply the content that is not defined in the master pages via the ContentPlaceHolder.
You then load the child pages, one at a time.

how to attach a external style sheet with evary page of asp

I have a CSS file called mystyle.css. I want to attach with each and every page of my application in asp.
How Can I do this?
at the top of your asp page, then your header page holds the CSS, Javascript etc etc
normally you would have header, footer in a seperate file and my method used to be to create one single asp page, then split the code into 3 pieces.
the header
the page
my footer
Have a look at ASP.NET Master Pages Overview it may be what you are looking for.
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.
You can't do this. ASP does not support master pages.

Resources