Example #1
0
        /// <summary>
        /// Handles the Edit event of the gLinkList control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RowEventArgs" /> instance containing the event data.</param>
        protected void gLinkList_Edit(object sender, RowEventArgs e)
        {
            var personalLink = new PersonalLinkService(new RockContext()).Get(e.RowKeyId);

            if (personalLink.PersonAliasId != CurrentPersonAliasId.Value && !personalLink.IsAuthorized(Authorization.EDIT, CurrentPerson))
            {
                mdGridWarning.Show("Not authorized to make changes to this link.", ModalAlertType.Information);
                return;
            }

            tbName.Text            = personalLink.Name;
            urlLink.Text           = personalLink.Url;
            hfPersonalLinkId.Value = personalLink.Id.ToString();

            mdAddPersonalLink.Title = "Edit Personal Link";
            mdAddPersonalLink.Show();
        }