Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8024477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:52:54+00:00 2026-06-04T22:52:54+00:00

We create a discussion board in Sharepoint 2010 without much effort, but I am

  • 0

We create a discussion board in Sharepoint 2010 without much effort, but I am looking for a solution where discussion board and all its replies are added to the certain zone automatically. That is end user do not need to add discussion board, through the process of entering page into edit mode and then adding web part. But instead, once user create a discussion board, all discussions and message are added to the page automatically (to certain zone in page).

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:52:56+00:00Added an answer on June 4, 2026 at 10:52 pm

    Add this code the a web event handler (ListAdded) in order to run this code automatically. In that code you will need to check if the list type is of Discussion. In the event receiver you will need get a reference to the SPWeb in which you want to add the web part, and to the list you want to use (in this example the Contacts list). Next you create an instance of the ListViewWebPart class, in which you can set the ZoneID, the ListName and the ViewGuid. This is the tricky part, the ListName property should contain the ID of your list (a GUID), not the name of your list!! But the ListName property is of the type string, so you need to convert the List GUID to a string using .ToString(“B”).ToUpper(). The same goes for the ViewGuid. Finally you need to get a reference to the WebPartCollection for the page in which you want to add the web part (in this example the home page, being default.aspx). Now you can add the web part using the Add method.

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebPartPages;
    
    // Get a reference to a web and a list
    SPSite site = new SPSite("http://localhost:8000");
    SPWeb web = site.OpenWeb();
    SPList list = web.Lists["Contacts"];
    
    // Instantiate the web part
    ListViewWebPart wp = new ListViewWebPart();
    wp.ZoneID = "Left";
    wp.ListName = list.ID.ToString("B").ToUpper();
    wp.ViewGuid = list.DefaultView.ID.ToString("B").ToUpper();
    
    // Get the web part collection
    SPWebPartCollection coll = 
        web.GetWebPartCollection("default.aspx", 
        Storage.Shared);
    
    // Add the web part
    coll.Add(wp);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to create a list definition based on the SharePoint Discussion Board
I have a Discussion Board in a SharePoint site which has an additional column
I have a web app that create groups. Each group gets their own discussion
This is probably going to be more of a discussion or hypothetical question, but
Let's create WinForms Application (I have Visual Studio 2008 running on Windows Vista, but
There is another similar question to mine, but the discussion veered away from the
My homework was to create a relational UML diagram about a discussion site. I
As a base for discussion. Create a standard ASP.NET MVC Web project. It will
I have read the discussion on how to create a DMG for Mac OS
I'm trying to create some threads in a service, but I got the hibernateException:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.