I'm trying to figure out a way where I can write html code to a SharePoint Web Part with C#. I don't even know if this is possible but I'm assuming it is. In JavaScript it would just be something along the lines of document.write("<br>" + variable + "</b>")
so I'm just trying to figure out how this will work in C#. There is a much bigger picture than this but this is the basic portion I'm stuck on.
I would like the HTML Code to be inside of the for
loop below.
Here's the code:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using System.Web;
namespace CSharpAttempt.VisualWebPart1
{
public class getTheSPItems
{
public void Page_Load(object sender, EventArgs e)
{
int i;
for (i = 0; i <= 10; i++)
{
string theHtmlString = "<b>" + i + "</b>";
Response.Write(theHtmlString);
}
}
}
public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}