protected void mailingListButton_Click(object sender, EventArgs e) { if (Page.IsValid) { using (FlexibleTennisLeagueDataContext dataContext = new FlexibleTennisLeagueDataContext()) { try { dataContext.InsertMailingList(mailingListEmailTextBox.Text, cityTextBox.Text); mailingListStatusLabel.Text = "We have received your email address. Thank you."; } catch { } } } }
protected void mailingListButton_Click(object sender, EventArgs e) { if (Page.IsValid) { using (FlexibleTennisLeagueDataContext dataContext = new FlexibleTennisLeagueDataContext()) { try { dataContext.InsertMailingList(mailingListEmailTextBox.Text, WebConfigurationManager.AppSettings["City"].ToString()); mailingListStatusLabel.Text = "We have received your email address. Thank you."; } catch { } } } }