.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

spmetal generated class and content type (for page layout) retrieve problem

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :SharePoint

I'm working with a console application to generate my sites and subsites (hierarchy). And i've got a problem with a generated spmetal class.


this doesn't work:


static void Main(string[] args)


            string SITE = string.Concat("http://"Environment.MachineName);         



View Complete Post

More Related Resource Links

SharePoint 2007 - Consolidating everything as feature into WSP [Content Type, Page Layout, Pages, Ma


Hello –


Overview – We are building a Mobile Web Site using SharePoint 2007. The big screen site has been already built and we need to integrate the mobile site into same site collection of big screen –


·         The Mobile site will use the existing content types of existing big screen site

·         We will build a new custom Master page

Redirect Page Layout: relative URL problem with content accessed by multiple URLs



I try to use the "Redirect Page" Layout to allow page to redirect to internal (relative url) content.

I ask users to put the URL in relative form: /doclist/docs/myfile.docx but when saved, the value takes the complete domain.


Then when we access the page using multiple URLs, the url is absolute and users can't access content (since I have one URL private for edition and multiple for reading).


Do you have any idea how I can fix this issue?


Thank you,



Change Content Type then Change Page Layout of an Existing Page


One of our content managers has added about 10 new web pages but has used the wrong page layout.  The site that these pages are in has 3 options of page layout that can be used.  They are:

(WDC Article) One Column-Std
(WDC Article) Two Column-Std
(WDC News) Public Notices and News

As you can see, there are 2 content types within the site.  The content manager has used the "(WDC Article) One Column-Std" page layout instead of the "(WDC News) Public Notices and News" page layout.

I have tried to edit the page layout via the 'Page Settings and Schedule' area but I only get the "(WDC Article) One Column-Std" and "(WDC Article) Two Column-Std" page layout options - there is no option to select "(WDC News) Public Notices and News".

I have tried to change the page content type from WDC Article to WDC News so I will have the "(WDC News) Public Notices and News" page layout option but it keeps reverting back to WDC Article or I get an error.

Any ideas of how I can change all pages that use "(WDC Article) One Column-Std" page layout to "(WDC News) Public Notices and News" page layout (the correct layout)?

Thanks :)

Content deployment: pages not based on a page layout

Is it possible to use content deplyoment feature when pages (in page library) are not based on a Page Layout?

Create buttons for "new item" which create a new page of a specific content type

We have a Pages library (wiki) which supports a few content types (and page layout associated). We want to enable users to click a button for example of "new custom enterprise wiki page" - so a new page of content type article will be open in edit mode. Can someone help how to develop? (it has to mimic the behavior that happens when user creates new page from the Ribbon or Site actions and has to choose the content type, it also has to keep the new page in edit mode and not just create it).  

Create a Page Layout for Enterprise Wiki with content

I need to create a Page Layout that for an Enterprise Wiki Page that already has content in the Rich Text HTML Field so when people go in to create a new page based off of the Page Layout they can go in and just replace the text with their own. Can this be done?

Problem running jquery script in Content Page

Hi!! I have a master page in asp.net and a content page with some basic asp.net controls like textbox,buttons,treeview....i have a jquery script in the content page and reference set to the jquery file..The script changes the text property of a button on the keydown event set for the textbox...the script works fine if i copy and paste it in a normal page...the script only ran once when i worte it for the first time the next day when i tried to run the script it was not working..i m facing this problem for running the script in content page and i a m not aware of how to write jquery script for the content page.. i m really not finding any solution where i am wrong i have even tried setting the internet explorer security setting to low..plz plz plz plz plz plz help me on Thanks!!

Form opening in infopath client despite Content Type settings "Display as a Web Page"

Hi all,   I have a strange behavior with my forms. The infopath template is defined as Content Type for my Form library, in the advanced settings I have checked "Display as a Web page" for the "Opening browser-enabled documents" setting. Despite that when the client is availble on the computer which is browsing the Form Library, I'm asked to "Open", "Save" or "Cancel" instead of opening the form in the browser.   Any idea why this is happening ?

Problem while creating task with custom content type in sharepoint workflow


Hi all,

I am trying to create task with custom content type in sharepoint statemachine workflow. But it is showing "Error Occured" after task creation code is excecuted. can anyone tell me what is the problem.

Task Content type


  <ContentType  ID="0x01080100A707C0079E8547c0A87515457DB90629"
      Description="Workflow Task"
      <FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Name="MyComments" DisplayName="MyComments"  />
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
        <FormUrls xmlns="

Inherited Page class type confusion


I have a single top-level window that holds a single object--a Page. I want the main window to resize based on the client area size (i.e., the Page size). I am doing this by having the main window resize property SizeToContent="WidthAndHeight".

My Page definitions:
    public class PageHelper {
        static public PageWelcome oPageWelcome = new PageWelcome();
        static public PageHelp1 oPageHelp1 = new PageHelp1();
        static public PageHelp2 oPageHelp2 = new PageHelp2();

If the user resizes the window, it should be easy enough adjust the size of the content Page (I haven't written the code yet). But what do I do when the user goes to a new page after resizing the window? It seems that I can either (1) resize all the pages when the user resizes the window, even the ones that are not active :(, or (2) I can make sure the new page is the right size when the user tries to go to it. :)  But I am having trouble with the latter approach.

I made my own Navigate function I call ACNavigateToPage which I want to call instead of calling Navigate when the user wants to go to a different page.

    public partial class WindowMain : NavigationWindow {

Content Type and Word properties problem



I defined a Site collection content type that have some required properties  and added it to a document library .

When we create a word document and then we try to save it in that document library , we have this message saying that some properties values are missing if we don't fill the mandatory ones

by pressing the button "Go to Document Information Panel"  the  “Retry  save” 

Cannot Display Application Page as Custom Form for Content Type



I've created a custom content type in VS. In "Elements.xml" file of my content type, I added my custom application page as new form and deployed as feature.

   <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">

Article page content type



I created a new document library called "Article". I added "Article Page" content type to this document library and also make it a default content type. But after I created a new page, the new page created in "Pages" document library.

What I am missing here?

Thanks in advance,



Specify content type of page in site definition



I wanted to ask. I want deploy my site definition, but I am not able (and I can't find any solution) to make my pages "wiki". I have page default.aspx in my site definition. But If I create new site from this definition, I can't edit default.aspx. I don't know, how define this. I think site definition must create "wiki-lists", but I don't know how. And I think I must create somewhere in default.aspx some Formated content. But I don't know how.

Can someone help me with little push. Or reference on existing answer or solution?


how to chnage page content type at runtime in MVC?



 I am working in asp.net MVC & on the view has to show both json & xml content depending on some condition.

I have to change the content type of the page  at runtime ie,

if the condition for json is fulfilled then set page contenttype = "text/json"


if the condition for xml is fulfilled then set page contenttype = "text/xml".


I have tried setting default content type on view as


@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" ContentType="text/json"%>

& in controller c

sharepoint changing content type layout has no effect on old pages




I have a content type layout. After I changed it, it had no effects on existing pages. 

When I add new page with this content type it has latest version.


How can I fix this? I want my current pages to use new content type layout.



Best practice: Page content type


Hi all,

I'm on a project where we want to assign some extra Site columns to the page content type.

Is it safe to simply add the site columns to the Page content type or should we create new content types which inherit the OOB Page content type and various other "page type" content types? (Publishing pages etc).

The requirement is that every page must have these extra fields/site columns.

Feedback would be appreciated.

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