.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 show list contents in two different sites

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :SharePoint
hello, how can i show list items in a two different sites..if i have a announcement list in my main site how can i show the  contents of the same list in another site ? i know we can use the webpage viewer but its not a good choice i want to show the list as same as it displayed on my source page...thanx

View Complete Post

More Related Resource Links

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Is it possible to show the displaying name instead of value in list?


Hi,I just created a custom field type to show all the users of the site.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls;

namespace WSS.CustomContentFields
  public class UserFieldControl : BaseFieldControl
    protected DropDownList ddlUsers;
    protected override string DefaultTemplateName
        return "UserFieldWebControl";
    public override object Value
        return this.ddlUsers.SelectedValue;
        this.ddlUsers.SelectedValue = (string)this.ItemFieldValue;

    protected override void CreateChildControls()
      if (this.Field == null || this.ControlMode == SPControlMode.Display)
      this.ddlUsers = (DropDownList)TemplateContainer.FindControl("ddlUsers");
      if (ddlUsers == null)
        throw new Exception("Error: cannot load .ascs file");
      if (!Page.IsPostBack)
        SPSite siteCollection = new SPSite(SPContext.GetContext(System.Web.HttpContext.Current).Site.Url);
        SPWeb site = siteCollection.OpenWeb()

Show total items for GridView in List.aspx or GridViewPager

Hi, Is there a solution to show total items in Grid View in List.aspx or GridViewPager Eg. Record: 1 - 20 of 231 

Create a custom search for searcing contents of a sharepoint list

Hi, I am new to sharepoint, i am working on a assignment to create a custom search for a specific sharepoint list . I would like to implement a search by multiple filter criteria's. I am using sharepoint 2007 and with no administrator privileges to the sharepoint server. Can someone guide me with this request. Thanks,  

Show value from Lookup List inside a view

I've got a Categories list, a Product list with a Category field defined as lookup value. The Product list is used in an OrderLine List. How can i show the category value from the selected Product in the OrderLine view? I tried calculcated columns, but they don't work on lookup columns. Would this be possible by creating a custom FieldType? (without performance problems, i assume there's a reason why calculated values don't work on lookup columns) Thanks Marco

How might I add a "Phone Call Memo" list to other sharepoint 2010 sites?


The group work site comes with that really nice list using it's custom content type and so on, I'm interested in being able to create that same list onto other sharepoint 2010 sites instead of having to use it only as the default list from that template.


Thank you for your help.

Show and hide items in the list as per permission (depend on the permission)


Dear all,

In sharepoint 2010

How I Show and hide items in the list as per permission.

i.e the user can fill the most fields in the list and we need to prevent him to see manager's fields in the same list.


How to show left menu and center of page contents in an ASPX page?


Scenario : Within sharepoint site user will click on a hyperlink which should take him to a new page and this new page will have the same header/footer (so I will create a copy of the masterpage with just header,footer) but the left side menu navigation will dynamically change and for each click event within the menu, the center of the page will show varying texts plus videos.

Need some directions as how I can acheive the above? What should I use to build menu control and similarly how to control the center text of the page.  

Can I acheive the entire above using webpart and if so how? Do I need to use user control for menu and for center text display webpart ? or else any other best options?  

Please suggest.

How to show list of dates a vehicle wasn't driven.


I have a table (ConsecDates) containing 1 field (Date). That table has a listing of consecutive dates for approx 2 years in it.

I have another table containg the Invoices for trucking jobs. This file contains an Invoice date field.

I need to know which dates an individual truck did NOT drive.

Is there any way to draw that information out of the Invoice table ?


Thanks in advance


how to make webpart only show top list item?

Our office is new to SharePoint (including me!).  On our new SharePoint intranet I want to create a SharePoint Tips list.  I then want to put a WebPart on the home page that only shows the most recent tip added to the list.  I can't figure out anyway to configure that.  Thanks for suggestions.

Column to show count of attachments uploaded for each List item in MOSS 2007


We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

How to delete the contents of the Workflow History List


I'm trying to purge the contents of the workflow history list which has thousands of comments added by the some workflows (I will fix the workflows later!). I'm worried that the huge number of entries in this list is slowing down the site performance. At this stage I do not need any of these entries for any audting or other purpose. I'm not sure of the best way to go about this.

My current strategy is to rely on the workflow autoclean sp timer job, after first running some code to set the AutoCleanupDays property of the SPWorkflowAssociation. I'm hoping that once I have run this on all the document libraries in my site where workflows have been run I will then be able to delete the Workflow History list using the Sharepoint Web UI "Delete this list" hyperlink.

When I do this at them moment I get an error as below:


Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))   at Microsoft.SharePoint.Library.SPRequestInternalClass.DeleteList(String bstrUrl, String bstrListName, UInt32 dwDeleteOp, Guid& pgDeleteTransactionId)
   at Microsoft.SharePoint.Library.SPRequest.DeleteList(String bstrUrl, String bstrListName, UInt32 dwDeleteOp, Guid& pgDeleteTransactionId)

Copy entire list including contents to a different SharePoint site


Hi: Just using the GUI in WSS 3.0, is it possible to copy an entire list including content from one site to another - asssuming I have admin rights to both sites? If so, how does one go about it?

Thanks in advance for your help.


Making foreign key entities not show on List screen



I have the following db design:

Table: Person





Table: Student

PersonId references Person table




On a list screen of Student, the Person is showing up as a dropdown search criteria.  Is there a way to remove the person search criteria from the List Screen?  I am using Visual Studio 2010.




Basic List Definition steps - cannot get columns to show up in New, Edit, etc.


Can someplease explain (since the MSDN docs don't) all the necessary stuff required to make a custom List Definition?  I'm trying to make a List Definition and in the schema.xml I've added some custom columns, as well as existing site columns, and I cannot get anything but the default items (from VS creation itself), like Title, to show up.  Some things I've tried:

1 - Yes, "ShowInNewForm", "ShowInEditForm", and "ShowInDisplayForm" are all set to True

2 - I've tried making an inline Content Type for these new columns (i.e., not a new ContentType element, just inside the Schemal.xml file)

I cannot ever get the custom columns to ever appear on anything other than a View.  Also, how the heck do you hide/get rid of the Title column if you don't need that?


Show templates currently used for sites

I'm trying to use export/import to move a site to another site collection and receive the message "exported site is based on the template STS#1 but the destination site is based on the template STS#0".   Is there an stsadm command that I can execute to show me what templates have been used for the sites?



data view web part unable to show data from list in subsite


Hello all,

In 2007, I never had any issues with doing this. In 2010, I created a web part that looks at the Pages list and pulls a few columns and as long as I am within the site, it works fine. But I need to call information from the Pages list in a subsite and display that information on the parent site default page.

In 2007, I made this work by changing ListID to ListName and DefaultValue="Pages" and then change the WebURL to DefaultValue="/SubsiteName/" then place it anywhere and it found it. Now if I change the ListID to ListName and default value to Pages I get an error that the web part cannot be imported. if I try using the actual ListID and change the WebURL to the subsite, I get an error that the web part is looking for a list that does not exist. This worked so easily in 2007.

Any one able to tell me what's going on? Or have a solution?

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