Implementing ISettingControl interface

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
12/11/2011 7:20:05 PM
Gravatar
Total Posts 63
Jerry McCreary
SureFire Studios, Inc.

Implementing ISettingControl interface

A couple of releated questions...

1) Can a UserControl that implements the ISettingControl be coded inline (that is, not using code behind)?

2) Does a UserControl that implements the ISettingControl have to be compiled into a DLL?

I've been looking at the various examples, such as those used for Google Maps; but I don't grasp the concept of implementing an interface (e.g. ISettingControl).

My goal:
I often develop quick "widget" type feature/module controls that will display data selected based on a topic or category id.
(For example:  I have a Customer Quotes module where I would like to have a custom feature setting that uses a drop down that has topics coming from a database)

Thanks for any help.

12/14/2011 5:12:04 PM
Gravatar
Total Posts 63
Jerry McCreary
SureFire Studios, Inc.

Re: Implementing ISettingControl interface

This is one approach I've tried. The control does not show up in the settings panel; but I'm not receiving any other error.  Can anyone help point me in the right direction?  Thanks.

%@ControlLanguage="C#"  AutoEventWireup="true"  Inherits="System.Web.UI.UserControl"  %
%@ImportNamespace="System" %
%@ImportNamespace="System.Web.UI" %
%@ImportNamespace="System.Web.UI.WebControls" %
<script runat="server">
public partial class ChooseTopicC : UserControl, ISettingControl

{

      protected globa l:: System.Web.UI.WebControls.DropDownList TopicDropdown;

      protected void Page_Load(object sender, EventArgs e)

        {

         }

       #region

       ISettingControl

          public string GetValue()
             {      
                   return TopicDropdown.SelectedValue;
                          }

       public   void SetValue(string val)

                        {
                  ListItem item = TopicDropdown.Items.FindByValue(val);

                           if (item != null)
                                   {
                              TopicDropdown.ClearSelection();

                                     item.Selected =true;
                                     }
                                   }

                                  #endregion

                          }

</script>

<asp:DropDownList ID="TopicDropdown" runat="server" EnableTheming="false" CssClass="forminput">
<asp:ListItem Value="1" Text="Topic1"/>
<asp:ListItem Value="2" Text="Topic2"/>
<asp:ListItem Value="3" Text="Topic3"/>
<asp:ListItem Value="4" Text="Topic4"/>
</asp:DropDownList>

 

 

 

 

12/24/2011 12:37:11 PM
Gravatar
Total Posts 18439

Re: Implementing ISettingControl interface

Are you sure no error is being logged?

You must sign in to post in the forums. This thread is closed to new posts.