コード例 #1
0
 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
             {
             }
         }
     }
 }
コード例 #2
0
 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
             {
             }
         }
     }
 }