Wednesday 19 March 2014

Create Sharepoint Hosted App in Visual Studio 2012 step by step

Create Sharepoint Hosted App in Visual Studio 2012 step by step

 Reference

http://nilsnaegele.com/codeedge/sharepoint2013basics3.html

Fire up visual studio on local machine and create a new sharepoint 2013 app



Provide these settings and click finish



In the app.manifest file view alot of the settings from napa



View the similarities in default.aspx file with the napa sharepoint web page file



The app.js file does the same thing as the napa app.js file, gets the users name, click start



Click on the getting started app



The app called back out to the server and displays the user name with a greeting



Create a new site collection, a developer site



File new project, an app for sharepoint 2013, click ok



Enter these settings and click finish



Inspect the files and folders in the project, then hit the start button



Click on the new app



Provide windows credentials



The code has run displaying the message



Add this code to the default.aspx file



Add this function to the app.js file



Hit start



Click the button and the message pops up



Navigate back to the host app



Open site contents



The app is listed right here, click on the x in the top right to close the app



View in visual studio output window that the app is retracted



Go back to sharepoint site and view in site contents that the app is no longer listed



In visual studio, in appmanifest.xml file click on browse to change the picture



Select a picture



View the png file has been added to the project, hit f5



View a brand new icon showing up for the app



File new project, app for sharepoint 2013



Specify these setting, note the provider hosted option selected



Note the creation of two projects, the first project is the sharepoint hosted app, the app package, the second project is an external remote web


In the appmanifest file set the appprincipal to internal, since no oauth will be used in this example



Add this code to the default.aspx file



Add this code to the code behind file



Hit the start button



View the app in the remote web, hosted on iis, click on the go back link



Navigate to site contents



View the bits of the sharepoint hosted app project, click on it



Again taken to the remote web hosted in iis



Add a list to the sharepont hosted app project



Specify these settings and click finish


 


View the announcements list has been added to the project



Add this code to the default.aspx page



Hit start to deploy the app



Open the app



Click on the announcements list hyperlink



Get a standard view of the announcements list, hit the back button



View the xslt web part, create a new announcement or edit the list options



Create a new site collection, a developer site



File new project, an empty sharepoint 2013 project



Specify these settings



Add a site column item to the project



Add these field definitions to the elements.xml file



Add a list to the project



Specify these settings



Add these columns to the columns tab



Add these 5 columns



In the views tab set the row limit to 10



In the list tab set the description



Add a new list to the project



Specify these settings



Select and order the selected columns



Set the description in the list tab



Add a new item, a module to the project



Delete the sample.txt file



Add 3 aspx pages to the module



The contents of page 1



Add a web part to page 2



And a web part to page 3



Make sure the faeture is included in the feature items



Open the package to see that all items are included



Add an event receiver to the feature



In feature designer set the scope to site, that is for all web sites in a site collection



Write code to create the navigation items in the top menu bar, in the featureactivated method



Clean up when deactiving the feature, remove the folder and the navigation nodes



Add a style sheet to the module



Add this css



Reference the style sheet in page 1



Hit the start button



View the navigation links in top menu bar created programmatically, click on page 1



Get routed to /NilsPages/Page1.aspx



View the customers and books list appear in the quick launch







No comments:

Post a Comment