Sharing A List Across Subsites

I’ve been looking for a way to share a list across subsites in Sharepoint for about two weeks! Finally I found out how to do it.

Steps to create a shared Sharepoint list.

  1. Create a list. In this case I created a custom list of employees.
  2. Open your site on Sharepoint Designer and click on the Lists and Librariesmenu item on the left. Then select your list on the right.
  3. Next click on the right hand side, under the Views section click on All Views.
  4. When the design editor pops up click on your list. Notice the ListView Tools on the ribbon at the top. Select the tab named Web Part.
  5. Once in the Web Part tab, on the far right there is a section named Save Web Part. Click on option called To Site Gallery. This is where the magic occurs, you will be prompted for a name to call your gallery on the Web Parts gallery. I will name my part Shared Employees List.
  6. On the following prompt click Yes to use the same data across all your sites.
  7. Save your changes, close Sharepoint Designer.
  8. Open, in edit mode, the page on the subsite you wish to display the shared list on.
  9. Click on Add a Web Part and scroll down to the bottom of the web part list. A folder named Miscellaneouswill now show up. Look it’s our shared list!
  10. Select your shared list and click Add. Afterward click the Stop Editing button to save our changes.

Woohoo! Our shared list is now displaying on a different subsite. However… Ideally we would want to filter the content to fit the needs of the other subsite. Lets do that next!

Steps to modify the view of a webpart.

  1. Mouse over the webpart on your page. A little downward arrow will display on the right side. Click it to reveal a menu. On that menu click Edit Web Part.
  2. On the new menu that appears on the right, click Edit Current View link in the List Views section.
  3. You will be redirected to an Edit View page. Do not be alarmed that the location on the top makes you think you are editing the view of the original list. You are not.
  4. The Edit View page will help you display only the values you need. In my case I am only going to show the employees in the Kids department. This is how I filter it.
  5. Scroll down and click OK to save.
  6. Congratulations your shared list is now showing only the filtered values but is connected to the main list so that when it gets updated, all the sites showing the list are updated automatically. Sweet!

I have to mention my source. Thanks +Laura Rogers on YouTube! Here’s her video of how to do this.

Applying Simple Ajax Functionality On Visual Studio

Here are the simple steps to applying ajax functionality to an aspx page using the UpdatePanel control.

  1. Drag and drop a ScriptManager item from the Ajax Extensions section on the toolbox onto the form you wish to add Ajax to.
  2. Drag and drop an UpdatePanel from the Ajax Extensions section on the toolbox onto the form you wish to add Ajax to.
  3. Drag and drop your form controls to the inside of the UpdatePanel.

It’s as simple as that. Here is what the code should look like on the Default.aspx page.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <asp:Label ID="lblMessage" runat="server" Text="Label"></asp:Label>
                <br />
                <asp:TextBox ID="txtMessage" runat="server"></asp:TextBox>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" />

And here is what the code-behind page (Default.aspx.vb) should look like. Keep in mind this is a very simple example.

Partial Class _Default
    Inherits System.Web.UI.Page
    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Me.lblMessage.Text = Me.txtMessage.Text
    End Sub
End Class

Accessing the System.Configuration.ConfigurationManager

I’ve always found Visual Studio to be a great tool for .NET programming. However I ran into a problem while I was trying to access a connection string from the App.config file. As usual I would import the namespace System.Configuration to access the ConfigurationManager. However the ConfigurationManager was nowhere to be found. After a whole night of searching, changing my code, and thinking that maybe I forgot how to access the App.config file, I found the solution.

Apparently typing in Imports.System.Configuration is not enough for you to see the ConfigurationManager these days, you actually have to go to Project > Add Reference, go to the .NET tab, scroll down, click on System.Configuration, and then click OK.