Content Sharing using Google Drive and ASP.NET MVC

Author: Shahim Sadakath


Hi Guys,
I made a small content sharing portal using Google Drive and ASP.NET MVC Hope you like it.
Things you must do before starting, 

1) Register as a developer in google - https://developers.google.com/
2) Create API Key and Client AUTH ID - https://developers.google.com/drive/v3/web/enable-sdk
3) Upload content to your google drive and grant public access

 

 


4) Create an ASP.NET MVC web application using Visual Studio
5) Create Page to Select and Save the ID of the uploaded content - Store.cshtml

@model BE.Video 




    
@*@using (Html.BeginForm("Store", "Business", FormMethod.Post))*@ @using (Ajax.BeginForm("Store", "Business", new AjaxOptions { HttpMethod = "POST" })) { @Html.AntiForgeryToken()

Video


@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.HiddenFor(model => model.ID) @Html.HiddenFor(model => model.CreatedBy) @Html.HiddenFor(model => model.DateCreated)
@Html.LabelFor(model => model.GDriveID, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.GDriveID, new { htmlAttributes = new { @class = "form-control", @id = "gdriveId" } }) @Html.ValidationMessageFor(model => model.GDriveID, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Description, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Description, "", new { @class = "text-danger" })
}

 

 

6) Create Page to View contents - Videos.cshtml

@model IEnumerable


@foreach (var video in Model) { if (Model.First() == video) { }

@video.Name

@video.Description

}


 

 

 

 



Tags: ASP.NET MVC GoogleDrive
Views: 975
Register for more exciting articles

Comments

Please login or register to post a comment.


There are currently no comments.