public new void LoadPage()
        {
            if (CurrentEvaluation.CurrentDimensionIndex == -1 || !CurrentEvaluation.CurrentDimensionIndex.HasValue)
            {
                Response.Redirect("/eval/timeout.aspx", true);
            }

            dimension = CurrentEvaluation.Dimensions[CurrentEvaluation.CurrentDimensionIndex.Value];

            if (!DisplayExistingValue())
            {
                lbNext.Attributes.Remove("disabled");
                lbNext.Attributes.Add("disabled", "disabled");
            }
            else
            {
                lbNext.CssClass = "next";
                lbNext.Attributes.Remove("disabled");
            }

            questionNo = 1;
            DisplayLevels(dimension);
        }
        private void SaveDimensionData()
        {
            if (CurrentEvaluation.Dimensions.Count == 0)
            {
                Response.Redirect("/eval/timeout.aspx", true);
            }
            else
            {
                Level level = new Level();
                List<Response> currentPageResponses = new List<Response>();

                if (CurrentEvaluation.CurrentDimensionIndex > 0 && CurrentEvaluation.CurrentDimensionIndex < CurrentEvaluation.NumDimensions)
                {
                    dimension = CurrentEvaluation.Dimensions[CurrentEvaluation.CurrentDimensionIndex.Value];
                    for (int i = 0; i < rptLevels.Items.Count; i++)
                    {
                        Repeater rptQuestions = rptLevels.Items[i].FindControl("rptQuestions") as Repeater;

                        for (int j = 0; j < rptQuestions.Items.Count; j++)
                        {
                            HtmlInputHidden hfQValue = rptQuestions.Items[j].FindControl("hfQValue") as HtmlInputHidden;
                            Response response = new Response();
                            response.DimensionID = dimension.ID;

                            if (dimension.ID == (int)DimensionEnum.Implementation)
                            {

                                response.QuestionID = dimension.Levels[i].Questions[j].ID;
                                if (hfQValue.Value == "yes")
                                {
                                    response.SelectedValue = ResponseEnum.yes;
                                    currentPageResponses.Add(response);
                                }
                                else if (hfQValue.Value == "no")
                                {
                                    response.SelectedValue = ResponseEnum.no;
                                    currentPageResponses.Add(response);
                                }
                            }
                            else
                            {
                                response.QuestionID = dimension.Levels[i].Questions[j].ID;
                                if (hfQValue.Value == "yes")
                                {
                                    response.SelectedValue = ResponseEnum.yes;
                                    currentPageResponses.Add(response);
                                }
                                else if (hfQValue.Value == "no")
                                {
                                    response.SelectedValue = ResponseEnum.no;
                                    currentPageResponses.Add(response);
                                }
                            }
                        }
                    }

                    if (currentLevel.Value != "max")
                    {
                        level = dimension.Levels.Find(i => i.ID == int.Parse(currentLevel.Value));
                    }
                    else
                    {
                        level = dimension.Levels.Last();
                    }

                    if (CurrentEvaluation.CurrentLevels.Find(i => i.DimensionID == dimension.ID) != null)
                    {
                        CurrentEvaluation.CurrentLevels[CurrentEvaluation.CurrentLevels.FindIndex(i => i.DimensionID == dimension.ID)] = level;
                    }
                    else
                    {
                        CurrentEvaluation.CurrentLevels.Add(level);
                    }
                }

                // Delete all responses for current dimension and re-save
                CurrentEvaluation.Responses.RemoveAll(i => i.DimensionID == dimension.ID);
                CurrentEvaluation.Responses.AddRange(currentPageResponses);

                SaveDimensionToDB(currentPageResponses, dimension.ID, level.ID);
            }
        }
        private void DisplayLevels(Dimension dimension)
        {
            List<Level> levels = dimension.Levels.Where(i => i.QuestionCount > 0).ToList();
            try
            {
                if (!existingValue)
                {
                    currentLevel.Value = levels[0].ID.ToString();
                }
                else if (CurrentEvaluation.CurrentLevels.Find(i => i.DimensionID == dimension.ID) != null)
                {
                    currentLevel.Value = CurrentEvaluation.CurrentLevels.Find(i => i.DimensionID == dimension.ID).ID.ToString();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("/eval/timeout.aspx", true);
            }

            rptLevels.DataSource = levels;
            rptLevels.DataBind();
        }