protected void OnAddNameMapClick(object sender, EventArgs e) { if (ddlCurrentName.SelectedItem != null && tbDestName.Text.Length > 0) { AuthorData data = AuthorData.Parse(ddlCurrentName.SelectedItem.Value); AuthorMap map = new AuthorMap(); map.BlogEngineAuthor = data; map.DesitnationAuthor.Name = tbDestName.Text; map.DesitnationAuthor.Email = !string.IsNullOrEmpty(tbDestEmail.Text) ? tbDestEmail.Text : data.Email; map.DesitnationAuthor.URL = !string.IsNullOrEmpty(tbDestUrl.Text) ? tbDestUrl.Text : data.URL; AuthorMaps.Add(map); tbDestName.Text = string.Empty; tbDestEmail.Text = string.Empty; tbDestUrl.Text = string.Empty; ddlCurrentName.Items.RemoveAt(ddlCurrentName.SelectedIndex); if (ddlCurrentName.Items.Count == 0) { btnAddNameMap.Enabled = false; } BindMap(); } }
protected void OnAddNameMapClick(object sender, EventArgs e) { if( ddlCurrentName.SelectedItem != null && tbDestName.Text.Length > 0 ) { AuthorData data = AuthorData.Parse(ddlCurrentName.SelectedItem.Value); AuthorMap map = new AuthorMap(); map.BlogEngineAuthor = data; map.DesitnationAuthor.Name = tbDestName.Text; map.DesitnationAuthor.Email = !string.IsNullOrEmpty(tbDestEmail.Text) ? tbDestEmail.Text : data.Email; map.DesitnationAuthor.URL = !string.IsNullOrEmpty(tbDestUrl.Text) ? tbDestUrl.Text : data.URL; AuthorMaps.Add(map); tbDestName.Text = string.Empty; tbDestEmail.Text = string.Empty; tbDestUrl.Text = string.Empty; ddlCurrentName.Items.RemoveAt(ddlCurrentName.SelectedIndex); if( ddlCurrentName.Items.Count == 0 ) btnAddNameMap.Enabled = false; BindMap(); } }