.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

Get Content type Id in dispform.aspx

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :SharePoint
I have added a data view web part to a DispForm.aspx of a particular list which displays the data from the child list associated to that particular list item in the parent list. In the Child data view web part I show the list of child items and a hyperlink to create a new child item.  But, the child list has 11 content types and i need to redirect to appropriate newform.aspx,how do i get the contenttypeid so that i can append to the url and redirectPlease remember to mark your question as "answered" if it solves your problem. My SharePoint Blog http://dhireny.blogspot.com

View Complete Post

More Related Resource Links

Content Type Title on Newform.aspx

I have a Calendar created with 8 Different Content types in it which are derived from Calendar Event and List item. In the Newform.aspx based on content type ID respective fields are present.
My Question is there a way to display Content type Name on Newform.aspx so that user's will come to If there are filling right now or not.

Not all content type columns show up in DisplayForm.aspx


I have a list that when displaying the DisplayForm.asp does not show all the columns of my content type.  I double checked that the column Status was Optional( not Hidden), so I don't understand why they don't show up.  Can anyone advise please?  For site visitors that only have View rights, DisplayForm is the logical way to view the list item, so they need to see all columns.


Edit - I was able to get the missing elements to display by switching the column to Required rather than Optional.  While I think this will work in my case because the new items are coming from a webservice that provides this data, it doesn't seem like this should be required.  I thought by default ALL columns/fields displayed on the forms UNLESS marked as hidden.

There are no mistakes; every result tells you something of value about what your are trying to accomplish.

Want to create a content type with its own Newform.aspx,editform.aspx,allitems.aspx by means of wiza



The wizard then creates a solution on visual studio. The code behind will write generic code for updating/adding into sharepoint.i is there a wizard which will create content type with individual aspx ? If there is a wizard utility which prompts you for fields and field types and then it will create code behind for the aspx.
With this done I can go at the code behind and ammend to put more logic. 


aspx page as a template for a content type



I've created a library of basic aspx pages.  I've turned on content types for that library.  i've added a content type called "Overview" and I want to attach a template to that content type.  The default template is _layout/bpcf.aspx.

How do I create an aspx page that can be added as a template to the content type?  Does it have to be added to the _layouts folder?  I've already discovered that you can't copy and paste it into the _layout folder. 

Is there a solution for aspx pages that does not involve the _layouts directory?


Thanks! Patti N.

Composite Control which contains arbitrary content defined in .aspx of parent and thier ViewState


I want to write own control which can contain other. And I want to define content of the control in the .aspx file where the control is defined. I have written such control. But now I have issue with ViewState of inner controls of my control. The following samle illustrates the issue: I defined two asp:DropDownList ID="ddl1" and ID="ddl2" One of them is inside of my control and other is outside. When posback is occurred asp:DropDownList ID="ddl1 loses state and becomes empty. How to say ASP.net to store state of inner controls defined by this way?


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyControl.ascx.cs" Inherits="DynamicControls.Controls.MyControl" %>

<div class="box">
    <div class="Header-Left">
        <div class="Header-Right">
            My Control
    <div class="Content">
        <asp:PlaceHolder ID="contentPlace" runat="Server" />

WSS 3.0 Content Type with Office 2007


We're currently encoutering an issue on our production servers with Office 2007 documents. In essence, the Content Type for all docx, xslx, and pptx documents cannot be changed away from the site default on all newly created sites.

I've even done some step by step debugging on an SPItem insert and I can set the content type to a custom type, but it reverts back to the site's default Content Type on Update(). Other file types - .doc, .xls, .tif, .txt, and .jpg - have all been tested, and all work as expected (the Content Type changes correctly).

Thanks in advance!


WSS 3.0 Content Type - Lost data for Titles


We are running WSS 3.0 SP2 on server 2003.  Recently, we lost the "Titles" for all content types for documents.  Our system Content Type for Document is set up to require this field to be completed on all documents that is uploaded.  Our system would automatically enter in by default the name of the document in the "Title" field it no longer does this for the user.  The user must now enter in manually the "Title".  How do I get it to enter in the "Title" using the document file name automatically?

Below is the way the setting page for Site Content Type: Document looks like.  (I tried to recreate it since I could place a screen shot in the box)

Site Content Type Information
Name:  Document
Descriptiong:  Create a new document.
Parent:  Item
Group:   Document Content Types

Name, Description, and group
Advanced settings
Workflow settings
Delete this site content type

Name                 Type                     &nb

BCS Updater Method in External Content type


HI, I have a List (External Content type ) with CRUD methods written.for example. Employee with fields






If want to update only Remarks field and want to display the other fields.(other field should not be editable). How can i do it throught VS2010. If I made those fields readOnly and preupdaterField true. those fields not displays while editing. I want to show those fields but not to edit. any suggestions????

2)while displaying (ReadList )if I want to display only EmpName and EmpID.How can i do it?


or please try to give some links about all the properties for a Type Decriptor and how they are related with CRUD methods.



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

Issue with List Definition of same base content type and deployed via same feature


I am trying to deploy two custom list definitions using only one single feature.  Below are the details of my issue.

  • Two custom list definitions
  • Each custom list definition has its own custom content type
  • Each custom content type inherits from the base content type Picture (Type = 109)
  • The custom list definitions are grouped together under one single feature
  • The custom content types are grouped together under a seperate single feature

When I deploy my solution in this configuration, the second list definition gets the first custom content type applied to it and the list schema from the first list definition is also applied to the second list definition.

What makes this more interesting, when I seperate both of the list definitions under two seperate features it all works fine.  Custom content types and list schemas get applied correctly.

Can anyone tell me why I can not deploy both list definitions under one single feature?

If you need me to post any of the origional code or XML to this post please let me know.



Content Editor Web Part in default.aspx not copied over.


I have a CEWP with some content in the default.aspx page on one site, and I downloaded and uploaded the default.aspx page to another site collection. But when I display the default.aspx page in the browser the CEWP is not there anymore.

Is the CEWP detached from the default.aspx page and must also be copied over to the new site collection? If so, then where is the CEWP stored?

Thanks for any help. 

Way of showing ID on the DispForm.aspx page without programming?

Is there a way of showing the ID system field on the DispForm.aspx page without programming.
I don't want to use a dataview, as new fields being added in the future won't appear automatically anymore this way on the DispForm.aspx page. 

I found somewhere that I could use a calculated field, with as formula =ID (so, in fact just copying the value of the ID field in the calculated field), which is one option.

Are there other options/solutions known?
Patrik | My Blog

Content Type Saved Incorrectly Using DataView


I have created a blank web part page and added a data view for my selected list in which I have enabled the insert/edit/delete options.  In that data view I have included the content type field (my list has 3 content types).  I am using JavaScript to set some fields defaults and to hide those fields, one being the content type field.  All seems to work correctly when submittin a new entry except that each item I save is always saved as the 1st content type.  I have tried inserting a new item without any JavaScript and have the same problem - no matter which content type I select from the drop-down list the item is always saved as the 1st content type.  Am I missing something here?  Surely I don't have to use the standard list form to insert new items into my list as I need to be able to control the user's interaction using the options available in the data view.

SharePoint Server 2007, SPD 2007, both SP2.

Thanks for any insight!

Creating SharePoint Server 2010 External Content Type Associations with SharePoint Designer 2010

Learn how to use Business Connectivity Services (BCS) to create associations between external content types in SharePoint Designer 2010 without using code.

Record Center and content type of the incoming documents


Hello all

I have same content types in both collboration site and record center sites.

When I used Send To command to send a document from collaboration area to record center, all the properties and metadata are promoted to columns in the Record center library. But the Content type of the document in record center is set to "Document" even though the incoming document's metadata has Content type value. Will all the records end up as Document content type if we are using default router?



Kiran Bellala

Read an XML file, setting uname/pw, Accept, Content-Type

Hi; To read some REST XML data we need to set the username, password, and tell it for the http request Accept: application/xml Content-Type: application/xml Is there a sample anywhere showing how to do this? thanks - daveVery funny video - Reporting as a Metaphor

Unable to collaborate on document in SharePoint Workspace which has Content Type with more than look

1/ Add a new document into Shared Document library. 2/ In Shared Document of this workspace, add new content type having 12 lookup columns. 3/ Create a new workspace 4/ Add a user into the workspace with the editable permission (Contribute or Full Control). 5/ Open the document in Word 2007, in the Document Management Pane Using system account: the document is shown in the Document tab. Using normal account: the document is not shown in the Document tab. 6/ If we use Dws.GetDwsMetaData method to get information of the workspace site and lists it contains then:    + Using system account credential, this method returns the document's information in Shared Document library. The result contains the below xml data: <List Name="Documents"> <ID>{CFEDFC3C-2AD3-4A0E-88B6-821BF57CACDB}</ID> <z:row ows_FileRef="Shared Documents/Test Content Type.docx" ows_FSObjType="0" ows_Created="2010-09-01T02:38:31Z" ows_Author="1073741823;#System Account" ows_Modified="2010-09-01T02:38:31Z" ows_Editor="1073741823;#System Account" ows_ID="1" ows_ProgID="" xmlns:z="#RowsetSchema" /> </List>     + Using the normal user credential, this method does not return the document information in Shared Document library. I notice
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