Example #1
0
        private void cmdStartRecordingNewSession_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid == false)
            {
                return;
            }

            clearSession();

            //Set up a new session

            objSession.sessionName        = "" + txtSessionName.Text;
            objSession.sessionDescription = "" + txtSessionDescription.Text;
            objSession.authenticationType = 0;
            objSession.applicationBaseUrl = "" + txtApplicationBaseUrl.Text;
            objSession.add();

            panelInitialSessionSetup.Visible = false;
            panelRecord.Visible        = true;
            panelRetrievedSite.Visible = true;

            Session["sessionId"]    = "" + objSession.id.ToString();
            Session["mode"]         = "record";
            Session["order"]        = "0";
            Session["payloadOrder"] = "0";


            cmdRecord.Enabled = false;

            objUrl.description  = "Auto Generated URL";
            objUrl.sessionId    = objSession.id;
            objUrl.sessionOrder = System.Convert.ToInt32(Session["order"]);
            objUrl.url          = txtUrl.Text;
            objUrl.add();

            Session["url"] = "" + objUrl.url;

            Session["urlId"] = objUrl.id.ToString();


            //Get Page
            strHtml = "" + objFormRedirect.getUrlAndRedirect(txtUrl.Text, System.Configuration.ConfigurationSettings.AppSettings.Get("siteRoot") + "default.aspx?pageId=46&pageUrl=" + System.Web.HttpUtility.UrlEncode(txtUrl.Text), System.Configuration.ConfigurationSettings.AppSettings.Get("siteRoot") + "default.aspx?pageId=46&pageUrl=", objSession.applicationBaseUrl);
            strHtml = strHtml.Replace("__VIEWSTATE", "__RETREIVEDVIEWSTATE");

            Literal objLiteral = new Literal();

            objLiteral.Text = strHtml;

            panelHtml.Controls.Add(objLiteral);
        }