Converting functional php site to asp.NET
<p>I have had a php site for about 10 years now, and tweaked and tuned it over these years to finally knock it down to a page of common functions, and about 10 content pages.</p>

<p>However, I want to learn .NET. I have touched on .NET at work in the past, but have never dealt with anything as... specific?... as my site there.</p>

<p>...OK, I am babbling, sorry. Bottom line is:
Can/should I be using a function in asp.net where in php I would have a function:</p>

<pre><code>&lt;? DrawMapTable("id", "MapName", "Description.", "Filename", "Players", "MapSize", "Game") ?&gt;
</code></pre>

<p>Which would draw a table, such as:</p>

<pre><code>&lt;h3&gt; &lt;a&gt; $mapNameFull &lt;/a&gt; &lt;/h3&gt;&lt;img class='mapImage' src='images/$mapName.png' alt='$mapNameFull' /&gt;&lt;p&gt;$mapDescription&lt;/p&gt;&lt;p&gt;&lt;a href='maps/$fileMapName'&gt;Download map: $mapNameFull&lt;/a&gt;&lt;/p&gt;
&lt;table class='mapTable'&gt;&lt;tr&gt;&lt;th class='mapTableCellBig'&gt; Map Name &lt;/th&gt;&lt;th class='mapTableCell'&gt; Players &lt;/th&gt;&lt;th class='mapTableCell'&gt; Dimensions &lt;/th&gt;&lt;th class='mapTableCell'&gt; Version &lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td class='mapTableCellBig'&gt; &lt;a href='maps/$fileMapName'&gt;$fileMapName&lt;/a&gt; &lt;/td&gt;&lt;td class='mapTableCell'&gt; $mapPlayers &lt;/td&gt;&lt;td class='mapTableCell'&gt; $mapDims &lt;/td&gt;&lt;td class='mapTableCell'&gt; $mapVersion &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
</code></pre>

<p>And if so, how?</p>

<p>ATTEMPT AT A BETTER EXPLANATION:</p>

<p>For example, if I have this in my master codebehind page:</p>

<pre><code>public String SectionBreak()
{
  string sHtml = "";
  sHtml += "  &lt;/td&gt;&lt;/tr&gt;\n";
  sHtml += "  &lt;tr&gt;&lt;td class='mainCell'&gt;\n";

  return sHtml;
}
</code></pre>

<ol>
<li>How would I call it in, say, default.aspx</li>
<li>Is this a horrible thing to do?</li>
</ol>

<p>Basically, I am trying to get away from using html in my content pages by obscuring it within functions that explain what the html is doing.</p>

<p>But the only way I can think to do this at the moment is to create a load of labels and have an onLoad for each of those labels, which would populate it with the code from, for example, SectionBreak().</p>
