public ActionResult Sample15() { // Check is data posted if (Request.HttpMethod == "POST") { //### Set variables and get POST data System.Collections.Hashtable result = new System.Collections.Hashtable(); String clientId = Request.Form["clientId"]; String privateKey = Request.Form["privateKey"]; result.Add("clientId", clientId); result.Add("privateKey", privateKey); Groupdocs.Api.Contract.DocumentViewsResult userInfo = null; String message = null; // Check is all needed fields are entered if (clientId == null || privateKey == null) { //If not all fields entered send error message message = "Please enter all parameters"; result.Add("error", message); // Transfer error message to template return View("Sample15", null, result); } else { String basePath = Request.Form["basePath"]; //Check is base path entered if (basePath.Equals("")) { //If base path empty set base path to the dev server basePath = "https://api.groupdocs.com/v2.0"; } result.Add("basePath", basePath); // Create service for Groupdocs account GroupdocsService service = new GroupdocsService(basePath, clientId, privateKey); // Get info about documents view userInfo = service.GetDocumentViews(0); //Return amount of elements which will be a views amount result.Add("views", userInfo.Views.Length); // Return Hashtable with results to the template return View("Sample15", null, result); } } // If data not posted return to template for filling of necessary fields else { return View("Sample15"); } }