Print Hello World message using SharePoint in Asp.Net 2.0?

Print Hello World message using SharePoint in Asp.Net 2.0?

using System;

using System.Collections.Generic;

using System.Text;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using Microsoft.SharePoint.WebPartPages;

namespace LoisAndClark.WPLibrary

{

public class MYWP : WebPart

{

protected override void CreateChildControls()

{

Content obj = new Content();

string str1 = obj.MyContent<string>(\"Hello World!\");

this.Controls.Add(new System.Web.UI.LiteralControl(str1));

}

}

}

 generic method shows that  SharePoint site is  running on .NET Framework

2.0, and the code of the generic method seems like this:

public string MyContent<MyType>(MyType arg)

{

return arg.ToString();

}


By:harry
Date:2029-12-08 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related ASP.NET SUB Links

ASP.NET SUB interview questions and answers for experienced and fresher