.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

Link to a custom page layout from a button

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#

Can anyone help out with a code snippet for the Click() method in a button - that opens a custom publishing page layout (I´ve made) when clicked on.

Instead of doing this the usual way by the Site Action meny.

C# code please =)


I use SharePoint 2010.

View Complete Post

More Related Resource Links

Redirecting to custom page while clicking on the user/group browse button

Hi, i have created a custom visual web part in visual studio 2010 and i deployed it into sharepoint site by creating a new page in my site. The custom page gets the data of users/groups from database and pass the users to the people picker in sharepoint.Here my question i have a document library where we upload document and get the users page popup that consists of people picker and a user/group browse button.when i click on the (book image button)browse button it will redirect to the user and group search page but here i need to replace my custom  user/group search page with the default one so please help me how to redirect to the custom page by clicking on the user/group browse button,and i need to pass the selected users to the people picker text box........please give me some solution whether this can be done or not if possibe please send me the link or some sample code how to do this   thank you.

How can I change XSL in WSS 3.0 for Search Layout - I need to add a button\link "Edit Item"?

Hi, WSS 3.0 on SQL Server 2008 for Workgroups Does anyone know where the xsl file is to change the Search Layout (NOT MOSS) and/or do you know of any links that are useful? Thanks. John.

how to provision Custom page layout and master page for subsite



I want to display the following page when  subsite of type  Custom site defination is created



Module Name="Brand" Url="

Set custom publishing page layout custom field programatically


I have a custom publishing page content type, based on the Publishing Article Page content type. On this content type, I have a custom field named "PageContentCategory". In my code to create new pages, I tried this:


PublishingPage newPublishingPage = this.currentPublishingWeb.GetPublishingPages().Add(pageName, newPageSelectedLayout);

if (pageContent.IsEmpty())
 pageContent = Properties.Resources.EAWorldArticleHandler_CreateNewArticlePage_DefaultPageContent;

newPublishingPage.ListItem[new Guid("{93496B35-7EC3-4132-B0D0-3BDC5606F5EF}")] = pageContentCategory;
newPublishingPage.ListItem[FieldId.PublishingPageContent] = pageContent;
newPublishingPage.Title = pageTitle;


I have also tried to set it by the field name:


PublishingPage newPublishingPage = this.currentPublishingWeb.GetPublishingPages().Add(pageName, newPageSelectedLayout);

How to create a custom page layout in sharepoint foundation 2010



I need to create a custom page layout in sharepoint foundation 2010.

I am aware that wss 3.0 and sharepoint foundation do not have the publishing infrastructure.

I need to know if the same procedure that is used to create custom web part pages in WSS 3.0 is to be used in SharePoint foundation too or are there other ways.

I am relatively a fresher to sharepoint technology.Please help.

Thanks in advance:D.


Page layout - Custom Multi line field limits at 255 chars



Hi group,


I hope i use the correct terms since I have a DUTCH :-( Sharepoint version.


I created a new Site Content Type, called activity.

I added a new column (Add from new site column)

The type of this column is: Multiple lines of text.

(I choose this because single line of text can contain up to 255 chars)


In Microsoft Office Sharepoint Designer (MOSD) I created a new pagelayout (File => new => Sharepoint Content => pagelayout)

and inserted the field activity to the .aspx page.

<SharePointWebControls:NoteField FieldName="Comments" runat="server"></SharePointWebControls:NoteField>

Why is the fieldname Comments I expected Activity?


I then created a new page (in MOSS) based on the created pagelayout.


Works like a charm.

Problem: I cannot add more than 255 chars to the field activity although it is a multiline type.

Does anybody

Creating MS Word Document programatically in sharepoint foundation as Link Button on Master Page?



Can any body help me how to create a new document programatically for OnClick of  a LinkButton on my Homepage  as per the requirement.

I had installed MS OfficeWebApps on my Development Server which its working fine but the "Create Document " is on Top Ribbon for which the link should be on the right side of the Content Page of Home.Aspx as per the req.

Pls guide me how to achieve this.


Thanks in Advance !!!!




Thanks in Advance !!! Cheers !!! Praveen

InfoPath 2010: Create custom "Table Templates" and "Page Layout Templates"


Is it possible to create your own table templates and/or page layout templates for InfoPath 2010?


How to set default Image to RichFieldImage control in custom Publishing Page layout in Site defini




How to set  default Image to RichFieldImage control  in custom Publishing Page layout in Site definition?


Cannot edit pages based on custom page layout


Hi guys!

I have created a site definition that applies a the publishing features and a feature containing some publishing page layouts before it creates some publishing pages based on these layouts.

My problem is that once I create a site based on this definition the resulting publishing pages are not editable. Also in the site definition one of the pages have a webpart added to one of the layouts containers that it should be based on, but when I try to open the page in the browser I get the error: "One or more Web Parts on this page references a zone that doesn't exist".

It appears that either my layouts or publishing page declarations are incorrect, but I cannot for the life of me figure out where. Any help would be greatly appreciated. I've been googling this problem for well over a week now :S


The module part of my site definition:

<Module Name="Homepage" Url="$Resources:cmscore,L

C# button to redirect user to a custom newform sharepoint page


I want to place a button in my C# web part  that will take the user to a new custom NewForm.aspx page I created.   I'm assuming this is straightforward but I can't find an example of the onClick event.  Can someone please assist?


Use custom page layout


Hi friends,

i have MOSS 2007 and have created a custom page layout in sharepoint designer.

now i want to create a page with that layout. how can i achieve this.

if anybody knows then please let me know complete procedure

Open custom aspx page as modal dialog from link


Here's what I'm trying to achieve. I got a url field in my list which contains a link to a custom aspx page I've created earlier. I've added the "&IsDlg=1" property to my url and I want to page to be opened as a modal dialog. However the page opens full window and not as a dialog at all.

Do I have to create a custom field? I've seen how to open a modal dialog with javascript, but my url field only accepts http://xxx aso so I'm screwed. Any help is very much appreciated.

SharePoint 2010 Custom Page Layout - No Publish option available



We built several custom page layouts in MOSS which we are upgrading to SharePoint 2010. If the page layout has custom code behind, the "Publish" tab is not available in the Ribbon. But if we change the Inherits attribute of the Page Tag to default "Micrsoft.SharePoint.Publishing.PublishingLayoutPage", we see the Publish Tab.

For example if the custom page layout has <%@ Page Language="C#" Inherits="Custom Namespace,Custom Assembly,Version=,Culture=neutral,PublicKeyToken="
    meta:progid="SharePoint.WebPartPage.Document"  %> , we dont see the Publish Tab in the ribbon.

The code from the code behind file executes when we access the page.

But if we change the Page Attribute to the default

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
    meta:progid="SharePoint.WebPartPage.Document" %> , we see the Publish Tab.

Any thoughts would be greatly appreciated.




Customize content query web part in custom page layout


I am trying to build a custom page layout which should have the following web parts:

1. Announcements,

2. Doc Library

3. custom list items

And the data in these web parts should be from the site in which we create this page. For example, if we try to create a page in site A, then the announcements displayed should be from site-A, doc lib that is in site-A...

And I am trying to insert a content query web part in the page layout using sharepoint designer, and modify the query to insert the announcements list in the site. But how can I query to pull the data from corresponding site.

Thanks for the help.

How can I add a contact-button to a wiki homepage and page layout?


I created an Enterprise Wiki using Sharepoint Server 2010 and I want to add a contact-button on both the wiki homepage and the page layout (for other wikipages). Can anyone tell me how to add this contact-button in Sharepoint Designer 2010?

Clicking the contact-button sends the user to an e-mailform, via which they can contact the administrator. Is there information available about how to create an e-mail form (page) in Sharepoint 2010?

(Please also see: "How can I add a search box to a wiki homepage?" http://social.technet.microsoft.com/Forums/en-us/sharepoint2010customization/thread/748549e2-5c4c-4971-b6f1-0105b57e1751)

Thanks a lot,


video tutorial link for composite and rendered custom server control


hii all

i am new to technology so go easy on this post

according to what i read from web there are 3 type of custom server controls

1 superclass

2 composite

3 rendered

i found video tutorial for superclass custom server control but couldnt find video tutials for other 2.

please forward me link for composite and rendered custom server controls video tutorial  

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