Recently I've shared an idea of how you could provide live site users with edit interface for custom module data. As you might know, perfection has no boundaries... This time I want to share some improvement, those will allow you to reuse the same web part for literally any object within your application.

I'm my first post on the related topic I've suggested using UI Form control in order to create/edit custom (or even native) objects within you system. It works perfectly fine with any particular object, but there is a limitation: you have to know what object you are going to work with beforehand. That's good, but not generic enough. So I went further and implemented class agnostic web part.
There were two challenges during implementation:

  • Instantiate object knowing just class code name when creating new object
  • Retrieve object data knowing just class code name and ID of an object when updating one
In first case ObjectTypeManager and a little bit of .net reflection were really useful.
In second case I knew ObjectQuery is the right path to go, but struggled with finding appropriate methods for data I have. Finally it turned to be really simple.
Following is entire code of my custom web part:

public partial class CMSWebParts_MyWebParts_EditObject : CMSAbstractWebPart
    public string Class
            return ValidationHelper.GetString(GetValue("Class"), "");
            SetValue("Class", value);

    public string Layout
            return ValidationHelper.GetString(GetValue("Layout"), "");
            SetValue("Layout", value);

    protected override void OnInit(EventArgs e)
        var id = -1;
        if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            id = int.Parse(Request.QueryString["id"]);

        var obj = ObjectTypeManager.GetTypeInfo(this.Class);

        BaseInfo bi = null;

        if (id > 0)
            var editObj = new ObjectQuery(this.Class)
                .WhereID(obj.ClassStructureInfo.IDColumn, id)
            bi = (BaseInfo)editObj;
            var newObj = Activator.CreateInstance(obj.InfoType);
            bi = (BaseInfo)newObj;

        EditForm.EditedObject = bi;
        EditForm.Mode = id > 0 ? FormModeEnum.Update : FormModeEnum.Insert;
        EditForm.ObjectSiteID = SiteContext.CurrentSiteID;
        EditForm.ObjectType = this.Class;
        EditForm.MessagesPlaceHolder = new CMS.ExtendedControls.MessagesPlaceHolder();

        EditForm.AlternativeFormName = AlternativeFormInfoProvider.GetAlternativeFormInfo(this.Layout).FormName;

    public override void OnContentLoaded()

    protected void SetupControl()
        if (StopProcessing)
            EditForm.StopProcessing = true;

This control is generic enough to work with any object you need. Class property allows you to select object class and Layout allows you to specify alternative layout for your form. Also you don't need to adjust your code behind whenever you add new field to the object UI Form will take care about it.

Please, feel free to share your thought, ideas, feedback or experiance on this topic.

roblox free robux
You can generate the roblox free robux here as it will allow you full access in playing this game and you will enjoy playing this game from the bottom of your heart.
9/1/2017 11:06:16 AM

Sarki Sozleri
We would like to inform you i simply take a look at your website as well as We think it is really fascinating as well as educational..
8/21/2017 2:12:59 PM

Thanks for share information.
8/1/2017 9:43:38 PM

Examcollection JK0-022 VCE
One way to think of a custom module is like a WordPress widget. A widget is this thing you can add to widget areas in a WordPress theme, only with HubSpot you don't need widget areas, you need flexible columns. Adding a flexible column to a page template takes a few clicks. Creating a new widget area takes custom code and editing core php files. Which would you rather do?

As I mentioned before, some common modules I build for clients are for statistics, case studies, testimonials, etc. Any part of the website that needs to look and function the same across multiple pages but will have different content depending on the page is a prime target to be turned into a custom module.
8/1/2017 6:38:35 AM

This really is actually fascinating, That you are a quite specialist blogger. Ive joined your rss feed and sit up for looking for more of your excellent post. Also, I have shared your web site in my social networks!
6/21/2017 6:35:45 PM

The Maharashtra State Board of Technical Education (MSBTE) declared the results for the MSBTE Summer Diploma examinations on Thursday. The candidates can check their grades on the official website msbte.com. As has been observed over the course of the past few weeks, the dates and times of result announcements have been frequently changed. The information above has not been independently verified. However, this article will continue to be updated to reflect official updates as and when they come in.
6/11/2017 9:48:12 PM

facetime for windows
facetime for windows
6/5/2017 11:59:39 AM

facetime for android
facetime for android
6/2/2017 11:20:03 AM

The wait of students is finally over as the Central Board of Secondary Education has announced the CBSE class 10th results. The students can check their results through the official websites of the CBSE Board.
5/17/2017 1:58:21 AM

up results nic in
The results for the Class 10th and Class 12th annual examination of the Uttar Pradesh Board will be announced in May.
5/11/2017 8:53:43 AM

videoder dowload
Videoder is an android app that lets you download music and videos from youtube, facebook, instagram, vimeo, dailymotion etc for free.
4/7/2017 9:36:07 AM

essay on time
Thank you so much for having the second part of the module data that is useful for me and help me a lot to complete my project on time. I really appreciate your great sharing and will visit yours again for upcoming projects help.
3/20/2017 12:53:31 PM

Are you waiting for AP Inter Results 2017? You visit the right place to know the information of Intermediate Results
3/19/2017 9:39:05 AM

I'm trying to implement your code... it displays the fields from the class just fine... but when i click the submit button i can track that both AfterValidate and BeforeSave is raised. OnValidationFailed is not raised so validation goes fine...
12/9/2016 1:54:38 PM

Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! By the way, how could we communicate?
12/1/2016 7:15:09 AM

This really is actually fascinating, That you are a quite specialist blogger. Ive joined your rss feed and sit up for looking for more of your excellent post. Also, I have shared your web site in my social networks!
10/26/2016 9:40:54 AM

 Security code