protected void Page_Load(object sender, EventArgs e)
 {
     context = new SurveyAppConString();
     if (!IsPostBack)
     {
         GetQuestions();
     }
 }
Exemple #2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         SurveyAppConString context = new SurveyAppConString();
         Question           quest   = new Question();
         quest.Text         = txtTitle.Text.Trim();
         quest.QuestionType = ddlTypes.SelectedItem.Text;
         quest.Options      = txtValues.Text.Trim();
         context.AddToQuestions(quest);
         context.SaveChanges();
     }
 }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     context = new SurveyAppConString();
     if (!IsPostBack)
     {
         LoadSurveys();
     }
     btnSubmit.Enabled = false;
     if (ddlSurveys.SelectedIndex > 0)
     {
         surveyid = int.Parse(ddlSurveys.SelectedValue);
         PopulateSurvey();
     }
 }