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

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

create page with default template from master page programmatically

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :ASP.Net

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

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!


Mysite Default Master Page



We have been using the mysite section of sharepoint for 6 months and have recently changed the default.master is there any quick way of changing all the users pages without losing anydata.

I know i can go into the Master Page library for the users, upload the new default.master and then set this as default within sharepoint designer, however this will be quite a lenghty task for me to complete for all our userbase.

Could you please advise if there is a quicker way to do this.

Programmatically Hide Master Pages from Site Master Page Settings page?



I know there is a field you can check when you edit the properties of a Master Page in the Master Page Gallery to set a Master Page to hidden but ... can anyone think of a way to programmatically hide specific Master Pages from the Site Master Page Settings page?

Maybe this should be two questions:

  1. How do I programmatically access a Master Page in a Master Page Gallery?
  2. Is there a property that can be set that will hide the page from the Site Master Page Settings page?

how to include template in master page


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..


Unable to create columns in document library after applying custom master page to site

Hi, I have applied a custom master page to a site.There is a document library in it. I am unable to add columns in it or change the default view.Nothing happens when I click on OK butoon after making my changes. However the columns are created/default view is changed when I apply the default master page. Guess I am missing some TagPrefix or sharepoint control on master page.I had solved this problem earlier in this way but don't remeber it now. Can anyone help?

How to create a master page.

Hi, I am in the process learning to create a master page through asp.net tutorial provided in this web site.I am able to understand all the concept but i am having problem in few area:(1).How do i to have the left div to be fill fully on the left. REfer to pic Left.jpg(2).How do i to have the bottom div at the bottom always at the  bottom and not affected by the length of the content page. REfer to bottom.jpgMy master page code behind is <body> <form id="form1" runat="server"> <div id="topContent"> <a href="Default.aspx">Master Pages Tutorials</a> </div> <div id="mainContent"> <asp:ContentPlaceHolder id="MainContent" runat="server"> </asp:ContentPlaceHolder> </div> <div id="leftContent"> <p style="text-align: center;"> <asp:Label ID="DateDisplay" runat="server"></asp:Label> </p> <asp:ContentPlaceHolder ID="QuickLoginUI" runat="server"> <asp:Login ID="QuickLogin" runat="server" TitleText="<h3>Sign In</h3>"

Retracting feature which deployed custom master page delete default.master

Hi, I am not sure if solution to this issue is already posted? I have my feature which copy my custom.master which is copy of default.master from hive to master page gallery of web. The problem is that everything works fine with feature activate and deactivate but when I retract the solution from the server. All pages except site settings page stop working saying "file not found". I redeploy the solution, it starts working again. Looks like the retract is deleting default.master as well? I have this issue in 2010 as well. Any help will be appreciated. Thanks, Kashish

create a dynamic field in the master page (site.Master)




I'm starting with ASP.NET MVC (1.0). I have a problem to resolve.

I have developed a web applicaton (an application of articles like e-commerce) with a head (logo and menu). I have defined the head (logo and menu) in the Master page (site.master). Now, I must display the number of articles in the head in a field (like the number of articles in the virtual basket in the e-commerce).

I can read the number of articles in the data base (in the controller), but i can't integrate it in the master page.


Please help ?   

Programmatically create publishing page and fill with content.


I have a bunch of HTML which has been exported from a different platform.
This HTML could be located in a database or contained within an HTML file. 

I am looking for some guidance on the best way to programmatically create a publishing page in SharePoint at a specific site location, then populating the RichHtmlField Publishing Web Control (PublishingPageContent) with the HTML that has been exported from one of the sources mentioned above.

Any suggestions/advice you can offer will be much appreciated.


Programmatically create a web part page in wss 3.0?

I understand how to create a web part page using sharepoint's nifty UI....i.e.:

- go to site actions > create > web part page

- On the 'New Web Part Page' form: give it a name, select a 'layout template', and choose a document library for it to go into to...then click create.

- On the 'edit mode' form for you new web part page: add web parts and select the appropriate options for each web part.

I need to do all of and exactly this....however I need to do it programmatically as a part of a sharepoint application page (in the code behind the application page, obviously)...in WSS 3.0.

I understand that it's possible to do this as a feature that can be added to a sharepoint site (haven't looked at the details here tho).

This doesn't work for me cuz the web part page needs to be generated dynamically (due to the fact that document libraries get generated dynamically). For context: I'm building a web part page the has several related lists (of various sorts) on one page.

Seems like this wouldn't be that uncommon a thing to do, but haven't seen anything written up about it. Is there something written that I've missed? Or does anyone have any helpful suggestions/hints for me?

thanks very much

How override inheritance from Default.Master page? How override default.master function acting on ju


 There is this one function that i can't remove from the Default.master page because other forms in the project use it and are happy to inherit from it. But in one form it messes up the layout as it injects a line below every text box to tell the user how many characters he's typed and how near the 1000 char limit he is. For this form we dont' need or want that on every asp:textbox. How can i keep the rest of the inheritance from Default.Master but exclude or avoid or override this function acting on textbox controls in this one form?

Here's the function as given in the default.master page, fyi:


function() {var countdown = {function() {//alert($(countdown.obj).attr('id'));

countdown.remaining = countdown.max - $(countdown.obj).val().length; 

$(countdown.obj).val($(countdown.obj).val().substring(0, countdown.max));

countdown.remaining = 0;


404 Page Not Found Error When Trying to Create a Site From a Custom Site Template


I just moved a site collection from a one server to another, and now I can't make copies of my sites using custom site templates.

The details of my site structure are in the next paragraph, in case they are relevant.
On the original server, I created custom templates for my sites, and checked the Include Content checkbox
when creating the templates. Everything works perfectly on that server. When I moved the whole site collection to another
server using stsadm backup/restore everything was there, including my customized web parts. But now I can't create new sites
from templates - and I'm I'm not trying to use templates created on the original server. I'm creating new templates on the new
server. It successfully creates the templates, but when I try to create a new site from one of those templates, I get a
"HTTP 404 Page Not Found" page. It succeeds in creating the new site, and the new site shows up in my navigation bar,
but when I click on the new site, I get a "404 Page Not Found" page.

On the original server, I created one top level site for my whole department. Under that, I have one subsite for each of our
external clients. Under each of those, I have one subsite for each project for that client. I used a Team site as my starting
point at each of the 3 leve

error.aspx page reports that Page.MasterPageFile = ~/masterurl/default.master not ~/_layouts/simple.


This one is driving me nuts.

I'm intercepting Pages using HTTPModules so that I can change the Master Page before the page loads. This works as expected on everything except error.aspx in the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS folder. Despite the fact that error.aspx specifies MasterPageFile="~/_layouts/simple.master" I keep getting Page.MasterPageFile = ~/masterurl/default.master instead!

Anybody know why this is the case?

Create new page from master causes list threshold error?


When I try to create a new page from master I get:

Server error: the attempted operation is prohibited because it exceeds the list view threshold enfoced by the administrator.

Why would I get this error from trying to create a new page from master?

Create a Wiki page from a template or form


after searching around all day for an appropriate answer I have come up with zilch

I have read alot of similar posts buth nothing seems to match my needs. Sorry if I'm just looking in the wrong place.
just found the following, exactly what I want too

What I am trying to do is create a template or form so users can click a link to create a new page from that template or form. what should i use and how should i do it? do i make a form? do i make a page layout??

a wiki page for each server that shows details about what services it runs and what network its on ect. ect.


hope this is clear as to what im talking about, just dont have the time at the moment to re think what im writing.
thanks in advance

create page with NEWS SITE TEMPLATE


Hi friends,

I am new in sharepoint 2010. this is my first time to create a News Site Template in sharepoint 2010.

but i am not able to find out NEWs site template. In sharepoint 2007. i have created a page with news site template under publishing tab.

but here i am not able to see this. please let me know where i can find out this

Is there a site page default.master in SharePoint Server 2010??



I inserted a few lines of code on the wkpstd.aspx template to "show" the document library properties on each wiki page within each wiki page library. This is working fine, except that the property Document ID
is showing up on site pages as well.  I checked Moss 2007 and I foumd that there is a bpcf.aspx default page that is used to create a basic page. Is there a separate template or master page for the site pages within 2010 that i can modify?

Any help or suggestion is greatly appreciated. Thanks.


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