Click here to Skip to main content
15,885,048 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="QuestechSystems.SharePoint.ApplicationPages.SiteProperty, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6c9c0cfe70b3391f" %>
<%@ 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="EditSiteProperty.aspx.cs" Inherits="QuestechSystems.SharePoint.ApplicationPages.EditSiteProperty" DynamicMasterPageFile="~masterurl/default.master" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script language="javascript" type="text/javascript">
    // <![CDATA[
    function confirmDelete() {
        return confirm("<SharePoint:EncodedLiteral runat='server' text='<%$Resources:QuestechSiteProperty,MsgSitePropertyConfirmDelete%>' EncodeMethod='EcmaScriptStringLiteralEncode'/>");
    }
    function _spFormOnSubmit() {
	    var L_alert1_text = "<SharePoint:EncodedLiteral runat='server' text='<%$Resources:QuestechSiteProperty,MsgSitePropertyNameEmpty%>' EncodeMethod='EcmaScriptStringLiteralEncode'/>";
	    document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(NameInputFormTextBox.ClientID),Response.Output);%>).value = TrimSpaces(document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(NameInputFormTextBox.ClientID),Response.Output);%>).value);
	    if (document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(NameInputFormTextBox.ClientID),Response.Output);%>).value.length < 1) {
		    window.alert(L_alert1_text);
		    document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(NameInputFormTextBox.ClientID),Response.Output);%>).focus();
		    return false;
	    }
    }
    function _spBodyOnLoad() {
	    try {
            document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(ValueInputFormTextBox.ClientID),Response.Output);%>).focus();
		    document.getElementById(<%SPHttpUtility.AddQuote(SPHttpUtility.NoEncode(ValueInputFormTextBox.ClientID),Response.Output);%>).select();
        } catch(e) {}
    }
    // ]]>
</script>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral runat="server" text="<%$Resources:QuestechSiteProperty,EditSiteProperty_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" /> <a href="./<%= QuestechSystems.SharePoint.ApplicationPages.Utility.PageNameManageSiteProperties %>"><asp:literal text='<%$Resources:QuestechSiteProperty,MngSiteProperties_PageTitle%>' runat="server"/></a>&#32;<SharePoint:ClusteredDirectionalSeparatorArrow runat="server" /> <asp:literal text='<%$Resources:QuestechSiteProperty,EditSiteProperty_PageTitle%>' runat="server"/>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <table class="propertysheet" border="0" width="100%" cellspacing="0" cellpadding="0">
    <wssuc:InputFormSection Title="<%$Resources:QuestechSiteProperty,SiteProperty_NameTitle%>" Description="<%$Resources:QuestechSiteProperty,SiteProperty_NameDescription%>" runat="server">
	    <Template_InputFormControls>
		    <wssuc:InputFormControl LabelText="<%$Resources:QuestechSiteProperty,SiteProperty_NameLabel%>" runat="server">
                <Template_Control>
                    <wssawc:InputFormTextBox ID="NameInputFormTextBox" Title="<%$Resources:QuestechSiteProperty,SiteProperty_NameInputTitle%>" class="ms-input" Columns="40" Runat="server" MaxLength="255" /><br/><asp:Label ID="NameErrorLabel" CssClass="ms-error" EnableViewState="false" runat="server" />
                </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>
    <wssuc:InputFormSection Title="<%$Resources:QuestechSiteProperty,SiteProperty_ValueTitle%>" Description="<%$Resources:QuestechSiteProperty,SiteProperty_ValueDescription%>" runat="server">
	    <Template_InputFormControls>
		    <wssuc:InputFormControl LabelText="<%$Resources:QuestechSiteProperty,SiteProperty_ValueLabel%>" runat="server">
                <Template_Control>
                    <wssawc:InputFormTextBox ID="ValueInputFormTextBox" Title="<%$Resources:QuestechSiteProperty,SiteProperty_ValueInputTitle%>" class="ms-input" Columns="40" Runat="server" MaxLength="255" />
                </Template_Control>
		    </wssuc:InputFormControl>
	    </Template_InputFormControls>
    </wssuc:InputFormSection>
    <wssuc:ButtonSection BottomSpacing="0" runat="server">
        <Template_Buttons>
       	    <asp:Button runat="server" class="ms-ButtonHeightWidth" OnClick="DeleteButton_Click" OnClientClick="return confirmDelete();" Text="<%$Resources:wss,multipages_deletebutton_text%>" ID="DeleteButton" accesskey="<%$Resources:wss,multipages_deletebutton_accesskey%>"/>
			<asp:PlaceHolder runat="server">
				&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;
			</asp:PlaceHolder>
            <asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" OnClick="OKButton_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" ID="OKButton" accesskey="<%$Resources:wss,okbutton_accesskey%>"/>
        </Template_Buttons>
    </wssuc:ButtonSection>
    </table>
</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