1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Editing ForumSettingsTemplate, where is the ID of forum?

Editing ForumSettingsTemplate, where is the ID of forum?

8 posts, 0 answered
  1. xax_007
    xax_007 avatar
    55 posts
    Registered:
    24 Jul 2009
    03 Dec 2009
    Link to this post
    Hello

    I´m implementing ascx.cs and ascx.designer.cs for ForumSettingsTemplate.ascx, but i don´t have the ID from my forum for update.

    Can you help me?

    Thanks,

    Salu2,
    Pablo
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    04 Dec 2009
    Link to this post
    Hi xax_007,

    The only way to get the id of the current forum is adding the following logic in the template ForumSettingsTemplate.ascx

    public void Page_Load(object sender, EventArgs e)
    {
        string name = this.forumNameText.Text;
        var manager = new Telerik.Forums.ForumManager();
        IList listofAll;
        listofAll = manager.GetForums(false);
        foreach (Telerik.Forums.IForum forum in listofAll)
        {
            if (forum.Name.Equals(name))
            {
                Response.Write("the current form ID is:" + forum.ID);
                break;
            }
        }
         
    }

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. xax_007
    xax_007 avatar
    55 posts
    Registered:
    24 Jul 2009
    09 Dec 2009
    Link to this post
    I´m editing a especific forum, no all, and when i go to options for forum I haven´t got the id.
  4. xax_007
    xax_007 avatar
    55 posts
    Registered:
    24 Jul 2009
    09 Dec 2009
    Link to this post
    The problem is that in Telerik.Sitefinity.Configuration.ControlsConfig.xml not work this:

    <viewSettings hostType="Telerik.Forums.WebControls.Admin.ControlPanel" >
          <views>
            <remove name="ControlPanel"></remove>
            <add name="ControlPanel" viewType="Forums.ForumSettingsTemplateCustom, Forums"></add>
          </views>
        </viewSettings>

    and not call my custom class.

    And If I do ascx.cs of ForumSettingsTemplate.ascx i can´t inherit of

    Telerik.Forums.WebControls.Admin.

    ControlPanel

     

    because is WebControl, not UserControl.

    if inherit of UserControl I haven´t got ID for forum...

    How I can do this?

  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Dec 2009
    Link to this post
    Hi xax_007,

    Telerik.Sitefinity.Configuration.ControlsConfig.xml does not work with not generic content based modules. You can directly inherit from the module and replace it in the <modules> section of project's web.config file.


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Gema
    Gema avatar
    46 posts
    Registered:
    02 Oct 2009
    09 Dec 2009
    Link to this post

    Hi Ivan,

    We are customizing ForumSettinsTemplate. We have added a treeview control  and we need to save selected values to the specified forum.
    Could you tell us which class subscribes save button command?

    We need to subscribe save button command in order to save our settings for selected forum item. We need to save default values, such as forum name, description,...., and our selected treeview nodes.

    Thanks

  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Dec 2009
    Link to this post
    Hi mgrp,

    You need to subscribe to click event of the LinkButton control with ID="saveChangesButton". Sample:

    this.saveChangesButton.Click += new EventHandler(saveChangesButton_Click);

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. xax_007
    xax_007 avatar
    55 posts
    Registered:
    24 Jul 2009
    10 Dec 2009
    Link to this post
    Finally I add ControlPanelAllForumsTemplate.ascx in my proyect and in the ascx.cs asociated to ascx in Grid DataBound, e.Argument have got the id.

    Thanks for all.
Register for webinar
8 posts, 0 answered