Agusto Xaverius P Sipahutar

Job:Making some bugs and patch
Moss/Wss,C#,Sql Server,WWF,K2.BlackPearl
Motto : Keep Study and study
See also: Other Geeks@INDC

News




MCP Logo
MCTS Logo

MCP ID# 3542391

My Curiculum Vitae


Agusto Xaverius P S's Facebook profile

Other Article

My Community

My Article/Share Knowledge

Others Moss/Wss Site

My Other Website/Blogs

My Share (Ebook,etc)

Membuat Custom Webpart Module di MojoPortal

Didalam MojoPortal ada 2 hal yang dapat lakukan untuk membuat module yang kita ingin lakukan.

1. Dengan Menggunakan WebPart

2. Dengan menggunakan Feature

 

Dengan Menggunakan WebPart

Silahkan unduh mojoportal source code / releasenya di http://www.mojoportal.com

Untuk membuat webpart pada mojo itu sangat gampang hal membuat class library kita menggunakan System.Web.UI.WebControls.WebParts.WebPart

Dengan langkah langkah sebagai berikut :

1. Code

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace SampleExternalWebPart
{

    public class SimpleWebPart : WebPart
    {
            private int itemCount = 5;

           public SimpleWebPart()
          {
                this.Title = "Simple Web Part";
                this.Description = "Simple WebPart Description";
           }

          [Personalizable, WebBrowsable, WebDescription("Number of articles to be displayed")]
        public int ItemCount
        {
            get { return itemCount; }
            set { itemCount = value; }
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
        }

        public override EditorPartCollection CreateEditorParts()
        {
            EditorPartCollection editorParts = base.CreateEditorParts();
            return editorParts;
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        public override WebPartVerbCollection Verbs
        {
            get
            {
                return base.Verbs;
            }
        }

        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.Write("This is a simple web part. You could say its the hello world of web parts.");
        }

    }
}

2. Deploy assembly file

    Dan setelah kita membuat coding tersebut kita compile dan copy assembly filenya ke bin tempat site mojoportal kita.

3. Register webpart ke MojoPortal Site

image

Klik Button Install.

image

Checked Available for MyPage dan klik Install

image

5.Penggunaan dalam Site

image

image

Klik Icon Edit pada WebPart Testing WebPart

image

Klik Button Save dan selesai WebPart sudah bisa digunakan.

Next publish akan bicara tentang Feature.

 

Happy Coding In MojoPortal

Share this post: | | | |
Posted: Oct 23 2008, 02:09 PM by agusto | with 5 comment(s)
Filed under: , ,

Comments

ariyo132 said:

Mantap kali pun...

Master, your kung fu is very good!

# October 23, 2008 5:22 PM

agusto said:

master drupal akhirnya keluar juga

# October 24, 2008 4:31 PM

ijnrxxqwfph said:

ZfYh12  <a href="ddyleqoekwkc.com/.../a>, [url=http://cxpjrgzxchvc.com/]cxpjrgzxchvc[/url], [link=http://uugawjhofxpl.com/]uugawjhofxpl[/link], http://iwehmeewygcl.com/

# November 11, 2008 9:00 PM

llousellullo.741.com said:

Hfxd1f http://llousellullo.741.com/

<a href="http://llousellullo.741.com/">llousellullo.741.com</a>

[url=http://llousellullo.741.com/]llousellullo.741.com[/url]

<a href=http://llousellullo.741.com/>llousellullo.741.com</a>

# March 28, 2009 11:05 PM

mqkdeiz said:

VH053M  <a href="vlvghxlbvtfx.com/.../a>, [url=http://hsmfojhypvzx.com/]hsmfojhypvzx[/url], [link=http://wkihuwkdrwsc.com/]wkihuwkdrwsc[/link], http://rfajvideuayr.com/

# April 14, 2009 6:11 PM