Click here to Skip to main content
15,883,705 members
Articles / Productivity Apps and Services / Sharepoint

Site Property Management (SharePoint 2010)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
11 Jul 2010CPOL4 min read 49.4K   712   14  
Provides an administrative UI to manage custom properties for a SharePoint site
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MngSiteProperties.aspx.cs" Inherits="QuestechSystems.SharePoint.ApplicationPages.MngSiteProperties" DynamicMasterPageFile="~masterurl/default.master" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
<%@ Import Namespace="QuestechSystems.SharePoint.ApplicationPages" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script language="javascript" type="text/javascript">
    // <![CDATA[
    function openSitePropertyDialog(url) {
        var dialogOptions = SP.UI.$create_DialogOptions();
        commonModalDialogOpen(
				url,
				dialogOptions,
				sitePropertiesDialogCallback,
				null);
    }
    function sitePropertiesDialogCallback(dialogResult, returnValue) {
        if (returnValue != null) {
            var notificationId = SP.UI.Notify.addNotification(returnValue, false);
        }
        //SP.UI.ModalDialog.RefreshPage(dialogResult);
        refreshUpdatePanelOnDialogCallback(dialogResult);
    }
    function refreshUpdatePanelOnDialogCallback(dialogResult) {
        if (dialogResult == SP.UI.DialogResult.OK) {
            __doPostBack(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(SitePropertiesUpdatePanel.ClientID),Response.Output);%>);
        }
    }
    // ]]>
</script>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral runat="server" text="<%$Resources:QuestechSiteProperty,MngSiteProperties_PageTitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
	<a href="../settings.aspx"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,settings_pagetitle%>" EncodeMethod="HtmlEncode"/></a>&#32;<SharePoint:ClusteredDirectionalSeparatorArrow runat="server" /> <asp:literal text='<%$Resources:QuestechSiteProperty,MngSiteProperties_PageTitle%>' runat="server"/>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
	<div>
		<wssuc:ToolBar id="AddToolBar" runat="server">
			<Template_Buttons>
				<wssuc:ToolBarButton runat="server" Text="<%$Resources:wss,multipages_createbutton_text%>"
					ID="AddToolBarButton"
					ToolTip="<%$Resources:QuestechSiteProperty,MngSiteProperties_AddProperty%>"
					NavigateUrl="javascript:openSitePropertyDialog(ADD_SITE_PROPERTY_URL);" ImageUrl="/_layouts/images/newitem.gif"
					AccessKey="C" />
			</Template_Buttons>
		</wssuc:ToolBar>
    </div>
    <asp:UpdatePanel ID="SitePropertiesUpdatePanel" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <SharePoint:SPGridView runat="server" ID="SitePropertiesGridView" Width="100%" AutoGenerateColumns="false" EnableViewState="false">
                <AlternatingRowStyle CssClass="ms-alternating" />
                <Columns>
                    <asp:TemplateField HeaderText="<%$Resources:QuestechSiteProperty,MngSiteProperties_HeadingName%>" HeaderStyle-Width="30%" HeaderStyle-CssClass="ms-vh2-nofilter">
                        <ItemTemplate>
                            <a href="#" onclick="openSitePropertyDialog('<%# Utility.GetEditSitePropertyUrl(SPHttpUtility.UrlKeyValueEncode((string)DataBinder.Eval(Container.DataItem, "Name"))) %>');return false;"><%# SPHttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem, "Name")) %></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Value" HeaderText="<%$Resources:QuestechSiteProperty,MngSiteProperties_HeadingValue%>" HeaderStyle-Width="70%" HeaderStyle-CssClass="ms-vh2-nofilter" />
                </Columns>
            </SharePoint:SPGridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Canada Canada
A Microsoft Certified Professional Developer and Technology Specialist.

Experience and expertise in SharePoint 2016 / 2013 / 2010 / 2007.

Role ranges from a developer in a multi-person team to a solution consultant with expert-level skills, leading a project to completion status.

Proven experience working effectively in a team environment and a self-managed environment.

Comments and Discussions