Create a list-based autohosted app in SharePoint 2013

InfoPath alternatives for form designing SharePoint

In this post we will discuss how to create a list based autohosted app in SharePoint 2013. Also you can check out my previous posts on:

– How to change site logo in SharePoint 2013?

– Change column name of list using SharePoint 2013 client object model in autohosted apps

– Add Custom Actions to List Item Menu in SharePoint 2010 Using SharePoint Designer 2010

Follow below steps:

Open Visual Studio 2012, Go to File -> New Project.

Then in the New Project dialog box, go to Office/SharePoint under Visual C#.

Then select App for SharePoint 2013 template as shown in the fig below:

Create a list-based autohosted app in SharePoint 2013
Create a list-based autohosted app in SharePoint 2013

Then in the next dialog box Give a name for the App, local debugging URL and then Choose the Autohosted hosting option as shown in the fig below:

Create a list-based autohosted app in SharePoint 2019
Create a list-based autohosted app in SharePoint 2019

On the Project menu, choose Add, New Item. When the Add New Item dialog box opens with the Office/SharePoint templates, choose List.

Specify name of the list, and choose Add.

After you add the list to the solution, you can add a column to the list using the user interface.

Add the following code inside the body of the default.aspx page.
<div>
<p>Click on TOD List for adding the thought in that list</p>
<asp:HyperLink ID=”HyperLink1″ runat=”server” Target=”_blank”>TOD</asp:HyperLink>
</div>

Add the following code in code behind under Page_load method in default.aspx.cs

string contextTokenString = TokenHelper.GetContextTokenFromRequest(Request);

SharePointContextToken contextToken =
TokenHelper.ReadAndValidateContextToken(contextTokenString, Request.Url.Authority);

Uri sharepointUrl = new Uri(Request.QueryString[“SPAppWebUrl”]);

HyperLink1.NavigateUrl = sharepointUrl.AbsoluteUri + “/Lists/TOD”;

Where TOD is a list name.

Now you deploy the apps and click that link than you able to show the list in autohosted apps.

Similar SharePoint 2013 Tutorials


About Navneet Singh

I am Navneet Singh, Working at C3it software solutions pvt. ltd. in Pune. My core skills are SharePoint 2013, Office 365, SharePoint 2010, SharePoint Designer, SharePoint Designer Workflow, Nintex Workflow, Infopath, Webpart, CSOM/SSOM, Power-shell, C#, ASP.NET and SQL Server.

View all posts by Navneet Singh →

Leave a Reply