Example #1
0
        /// <summary>
        /// Event handler of Add tag button.
        /// </summary>
        /// <param name="sender">Sender parameter</param>
        /// <param name="e">EventArg parameter</param>
        /// <remarks>
        /// It adds tags are in Add tag textbox separated by spaces.
        /// </remarks>
        void BtnAddTagClick(object sender, EventArgs e)
        {
            var names = _tbAddTag.Text.Trim(',', ' ').Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            foreach (var name in names)
            {
                TagManager.AddToRepository(name, TagPath);
            }
            Response.Redirect(String.Format("{0}?{1}", Portal.Page.Current.Path, Request.QueryString));
        }
Example #2
0
        /// <summary>
        /// Event handler of Add tag button.
        /// </summary>
        /// <param name="sender">Sender parameter</param>
        /// <param name="e">EventArg parameter</param>
        /// <remarks>
        /// It adds tags are in Add tag textbox separated by spaces.
        /// </remarks>
        void BtnAddTagClick(object sender, EventArgs e)
        {
            var names = _tbAddTag.Text.Trim(',', ' ').Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            foreach (var name in names)
            {
                try
                {
                    if (!TagManager.IsInRepository(name, TagPath))
                    {
                        TagManager.AddToRepository(name, TagPath);
                    }
                }
                catch (Exception ex)
                {
                    Logger.WriteWarning(1, "Error during tag creation. Tagname: " + name + ". Error: " + ex);
                }
            }
            Response.Redirect(String.Format("{0}?{1}", Portal.Page.Current.Path, Request.QueryString));
        }