protected void Page_Load(object sender, EventArgs e) { context = new SurveyAppConString(); if (!IsPostBack) { GetQuestions(); } }
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(); } }
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(); } }