.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to include template in master page

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

Hi! I am new to asp.net... i hv downloaded some templates for my master page but dont know how to incud them in my website... plz help..


View Complete Post

More Related Resource Links

What's the "right" way to create a site template and inherit a custom master page?


Correct me if I'm wrong, but in 2007 whatever masterpage you had selected was saved in the site template and was re-created when a new site was created from said template.

It occurs to me that it's different in 2010.

Custom master pages from a site template aren't inherited and they don't keep the specified value when you ask it to before creating the template itself.

So, what's the "correct" way?  What's the difference in making a site template using a blank site or publishing site?

Here I thought I'd be able to make a site template and move on to my next project.

Thanks in advance!


create page with default template from master page programmatically


hi, exactly like cms , i want to create page programmatically with this options:

1: page-name

2: add template (master-page)

and etc...

help me .thanks

How to include javascript reference in master page Asp .Net C# 2.0


I am using Asp.Net C# 2.0. My website is working fine in local. Website contains 2 js files included in master page.  It works fine in local environment, but when i publish my website i get "Object expected" error on page load, and thus the js functions are not working in published website. 

Currently i am writing <script src="/javascripts/jquery.hotkeys-0.7.9.js" type="text/javascript"></script> in master page.

Looking forward for help.

Thanxs in Advance.

Unique content within master page based on conditions met


 Hi all-

I would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx).  The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. 

However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML,  Divs and databound gridview content.  The HTML content will be stored in the database.

Can someone point me in the right direction for best practices on how to accomplish this?


Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


Not getting multiple composite controls on master page


I have created two composite controls in the same assembly and registered that assembly in a master page using <%@ Register tag.

When I try to use these controls using the registered tag prefix I am getting only one control along with the tagprefix .

How to get all the composite controls present in the registered assembly?

Master Pages: Master Your Site Design with Visual Inheritance and Page Templates


Master pages in ASP.NET 2.0 solve a problem many Web developers have been solving on their own with a variety of techniques for years - providing a single master template for an entire site. This article covers the details of master pages, discussing their usage and implementation and how they are a natural evolution of custom techniques developers are using today.

Fritz Onion

MSDN Magazine June 2004

Dynamic Checkboxlist exception when adding to Panel when using Master Page


In essence, I am creating Dynamic Checkboxlist controls and adding them to a Panel.  It works well when I do not have a Master Page configure to this webpage. Once I have a masterpage congifured.. I get a "Object Reference not set to instance of object" error on the Panel_Control.Controls.Add(Checkboxlistnew) line:

protected void Page_PreInit(object sender, EventArgs e)
        XML OXML = new XML();
        alistChkBoxLabels = OXML.XMLTransform("C:\\Documents and Settings\..\\Config_new.xml", "config_options/check_box/applications/app/@name");
        int count = 1;
        alistCheckisFacility = new ArrayList();
        alIDTracker = new ArrayList();
        while (count <= alistChkBoxLabels.Count)

            Checkboxlistnew = new CheckBoxList();
            Checkboxlistnew.ID = count.ToString();
            Checkboxlistnew.Items.Add(new ListItem(alistChkBoxLabels[count - 1].ToString(), alistChkBoxLabels[count - 1].ToString()));

            String sAppName = alistChkBoxLabels[count - 1].ToString().Trim();

            alistCheckisFacility = OXML.XMLTransform("C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2005\\WebSites\\User_Trial\\Config_new

Button click in master page use in other pages I have to click twice. Why?


In my masterpage I have a menu with buttons. I want the buttons to do something after click. It works but I have to click twice on the button, why? What do I have to do to just to click once?

Is master page a best alternative for Frame Sets ??


My webpage has one banner with a logo, a vertical menu bar on the left side of the page and a footer . I have 5 other pages which should get loaded when the user select them from the menu bar. what my concern is actually the banner,  menu bar  and the footer should not change when the requested page loads. This definitely can be handled by sets. But I want to know whether there are any other alternatives for frame sets or could master page be helpful for this purpose ????? 

Any help would be appreciative .

DropDownMenu disapper in master page


Dear all,


I have master page and wen i use master page my drop down menu selection disapper in web forms...could anyone pls help me...am not so clear about z-index...








@ Master Language="VB" AutoEventWireup="false" CodeBehind="Default.master.vb" Inherits="E_Management._Default1" %>

Apply custom.master to "Site Settings" page?


I'm using a custom.master page, which is applied to almost all pages available to READ users.

However, I'd like to apply it to the Search, Site Settings, and View All Site Content pages.

I'm not sure where this would be applied.

Guidance much appreciated. Thanks!

creating different sub page design template in sharepoint website


I know very little about sharepoint and have outsourced the design of a master page and sub page design for a new website using sharepoint. i received a site master file with all of the necessary images and the home page works just fine. However the file i received for the sub page design template was an ASPX file with the following instructions:


Here I enclosed the inner page layout file. You upload this file by using following instructions. you can change & edit the blue menu section in the master page itself. If I change into modifiable section you need to add the menu in each and every page, otherwise it will show as empty block. Please let me know your comments.


Steps for uploading inner page layout page.


1.Select the Site Actions button and click on Site Settings->Modify All site settings

Sharepoint 2007 - Wiki site - New Pages Not Inheriting Custom Master Page


I am working on a SP site (MOSS not WSS) which is heavily customised away from the OOTB layout. I need to create a Wiki site, which was going well - I've created a master page which displays the miniconsole (this was not visible with our customised layout), and made it the default master page for the site. This has been applied to the two standard pages that come with the Wiki site, however when a new page is created, it seems to inherit the default.master, rather than my custom master page - thus not showing the miniconsole.

When I have created a new page, I am able to use SharePoint Designer to attach my custom master page to it, which works perfectly, however this will not be a viable option going forward as end-users create their new wiki pages.

How can I get the new pages to inherit my master page when they are created?


Master Page manipulation


I've never worked with ASP.net before this project, and I am struggling a bit.  The website I am updating was written in ASP.net and C#, using a master page.  The master page is simple enough (header section, maincontent section, footer section, and a righcontent section).

What I need to happen...

On one page only, I would like the maincontent section to extend through the rightcontent section.  On this page I will not need the rightcontent section.

What is the easiest way to produce these results?  As of now, I have unused space on the page...and I can't figure out how to utilize the extra white space.  

Please advise.

Use of Master Page



can anyone tell me use of Master Page in ASP.Net


Pratik Asthana

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend