protected void cloneLink_Click1(object sender, System.EventArgs e)
        {
            int questionId = int.Parse(((LinkButton)sender).CommandArgument);
            var question = new Questions().GetQuestionById(questionId, null);
            var newQuestion = new Question().CloneQuestionById(questionId);

            var q = newQuestion.Questions[0];
            if (q.SelectionModeId == 4)
                UINavigator.NavigateToMatrixQuestionEdit(q.SurveyId, q.QuestionId, -1, -1);
            else
                UINavigator.NavigateToSingleQuestionEdit(q.SurveyId, q.QuestionId, -1, -1);
        }
        private void AddQuestionToLibrary()
        {
            if (QuestionDropDownList.SelectedValue == "single")
            {
                // Adds the new single question to the library 
                QuestionData newQuestion =
                    new Question().AddDefaultSingleQuestion(_libraryId, Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToSingleQuestionEdit(getSurveyId(), newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else if (QuestionDropDownList.SelectedValue == "matrix")
            {
                // Adds the new parent matrix question to the library
                QuestionData newQuestion =
                    new Question().AddDefaultMatrixQuestion(_libraryId, Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToMatrixQuestionEdit(getSurveyId(), newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);

            }
            else
            {
                new Question().AddStaticInformationText(_libraryId, Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);
                UINavigator.NavigateToLibraryTemplates(getSurveyId(), _libraryId, MenuIndex);
            }
        }
        private void AddQuestion()
        {
            if (QuestionDropDownList.SelectedValue == "single")
            {
                // Adds the new single question


                QuestionData newQuestion =
                    new Question().AddDefaultSingleQuestion(SurveyId, _displayOrder, _pageNumber,
                   Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToSingleQuestionEdit(getSurveyId(), newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else if (QuestionDropDownList.SelectedValue == "matrix")
            {
                // Adds the new parent matrix question H:\SurveyProject\SurveyWAP\Images\
                QuestionData newQuestion =
                    new Question().AddDefaultMatrixQuestion(SurveyId, _displayOrder, _pageNumber,
                    Server.HtmlDecode(QuestionFreeTextBox.Text), txtQuestionID.Text);

                UINavigator.NavigateToMatrixQuestionEdit(SurveyId, newQuestion.Questions[0].QuestionId, _libraryId, MenuIndex);
            }
            else
            {
                new Question().AddStaticInformationText(SurveyId, _displayOrder, _pageNumber, QuestionFreeTextBox.Text, txtQuestionID.Text);
                UINavigator.NavigateToSurveyBuilder(SurveyId, MenuIndex);
            }
        }