Scripts\App js


Download 124.43 Kb.
NameScripts\App js
A typeScript

Demo 1: Hello, Apps


In this Demo, you will create a simple SharePoint App using Visual Studio. This Demo will familiarize you with the development process, toolset, and patterns for simple App development.

1.Step 1 – Create a New App


In this Step, you will develop a new App in Visual Studio

  1. Open Microsoft Visual Studio 2012 and create a new SharePoint App project

    1. Open Microsoft Visual Studio 2012

    2. Select FileNew Project from the main menu

    3. Click the TemplatesVisual C#Office/SharePointApps node and select the App for SharePoint 2013 project template

    4. Name the new project HelloApp

    5. Click the OK button

    6. In the SharePoint Customization Wizard, name the new App Hello, App.

    7. Specify the site you will use for this lab.

    8. Select SharePoint-hosted as the hosting type.

    9. Click Finish.

  2. Code the App

    1. Open Pages\Default.aspx for editing.

    2. Add the code below within the PlaceHolderMain Content Placeholder control:




    1. Open Scripts\App.js for editing.

    2. Add the following code to the library:

function hello() {

$get("displayDiv").innerHTML = "
Hello, Apps!
";

}

2.Step 2 – Run the App in Debug mode


In this Step, you will run the App and see it hosted in SharePoint.

  1. Run the App

    1. In Visual Studio, select DebugStart Debugging, observe the Output Window for installation messages.

    2. Launch the App

    3. In the App, click the Push Me button.

  2. Shutdown the App

    1. In Visual Studio, select DebugStop Debugging, observe the Output Window for retraction messages.

3.Step 3 – Add a Client Web Part to the App


In this Step, you will add a Client Web Part and code it. This web part can be used on pages outside of the App to add functionality to the hosting SharePoint site.

  1. Add a Client Web Part

    1. In the Solution Explorer, right click the HelloApp project node and select AddNew Item from the context menu.

    2. In the Add New Item dialog, select Client Web Part.

    3. Name the new item AppPart and click Add.

    4. Replace the entire contents of the Elements file with the following:






Title="App Part"

Description="A simple client web part"

DefaultWidth="200"

DefaultHeight="200">


Type="html"

Src="~appWebUrl/Pages/AppPartSource.aspx?

Message=_DisplayMessage_" />

Type="string"

WebBrowsable="true"

WebDisplayName="Display Message"

WebDescription="A message to display"

WebCategory="Configuration"

DefaultValue="Hello, Client Web Part!"

RequiresDesignerPermission="true" />





    1. In the Solution Explorer, right click the Pages folder node and select AddNew Item from the context menu.

    2. In the Add New Item dialog, select Visual C# ItemsWebHTML Page.

    3. Name the new item AppPartSource.aspx and click Add.

    4. Replace the contents of the page with the following:

<%@ Page language="C#"

Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,

Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral,

PublicKeyToken=71e9bce111e9429c" %>

<%@ Register Tagprefix="SharePoint"

Namespace="Microsoft.SharePoint.WebControls"

Assembly="Microsoft.SharePoint, Version=15.0.0.0,

Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register Tagprefix="Utilities"

Namespace="Microsoft.SharePoint.Utilities"

Assembly="Microsoft.SharePoint, Version=15.0.0.0,

Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register Tagprefix="WebPartPages"

Namespace="Microsoft.SharePoint.WebPartPages"

Assembly="Microsoft.SharePoint, Version=15.0.0.0,

Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>





Client Web Part




runat="server" OnDemand="true" LoadAfterUI="true"

Localizable="false" />

















Share in:

Related:

Scripts\\App js iconSigning app Note: signing the app is only necessary when you intend...

Scripts\\App js iconDownload the app To get started, make sure you are using an iPhone...

Scripts\\App js iconDescription of Product: Outlook Mobile app for ios is the business-class...

Scripts\\App js iconBlind Square is a combination Point of Interest poi and basic navigating...

Scripts\\App js iconIs the app name that appears to users. For this project, use "My First App."

Scripts\\App js iconWalkthrough: Deploying a SignalR autohosted App to Office 365 Written...

Scripts\\App js iconClaroCom is an ios app designed for aac (Augmentative and Alternative...

Scripts\\App js iconScripts and tools

Scripts\\App js iconScripts Editors

Scripts\\App js iconR scripts for Chapter 12




forms and shapes


When copying material provide a link © 2017
contacts
filling-form.info
search