Previous Walkthrough Next Walkthrough


Walkthrough 2: Loading an Answer File and Other Session Options

Prerequisites:

  1. A copy of the "EmploymentAgreement" project created in Walkthrough #1.  (Copy the entire project directory structure and work with the copy, leaving the original unmodified for use in other walkthroughs.)

Instructions:

  1. Add the following parameter to the CreateSession call in Default.aspx.cs.  This will load the initial answer set from the specified URL.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using HotDocs.Cloud.Client;
        
    namespace EmploymentAgreement
    {
        public partial class Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
     
            }
     
            protected string GetSessionID()
            {
                var client = new RestClient("SUBSCRIPTION_ID""SIGNING_KEY");
                return client.CreateSession("Employment Agreement", Server.MapPath("~/EmploymentAgreement.hdpkg"),
                    answers: (new System.Net.WebClient()).DownloadString("http://files.hotdocs.ws/walkthrough/EmploymentAgreement.anx"));
            }
        }
    }
  2. Build and run the web app.



  3. The CreateSession call has several other optional parameters that you may want to try.  For example:

Previous Walkthrough Next Walkthrough