Wednesday, 28 December 2011

hello world webpart


: Coding for Hello world Web Part

using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace helloworld.helloworldwebpart
{
    [ToolboxItemAttribute(false)]
    public class helloworldwebpart : WebPart
    {
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            this.Controls.Add(new LiteralControl("<html><body>"));
            this.Controls.Add(new LiteralControl("<h1 style='font-size: large; color:  #0000FF; text-align: center; text-decoration: blink'>Hello, world! Welcome to Sharepoint world</h1>"));
            this.Controls.Add(new LiteralControl("</body></html>"));
        }
    }
}

No comments:

Post a Comment