putting a function in class instead of code behind
<p>I have a function in a code behind file that's used to respond to a gridview event:</p>

<pre><code>protected void GridviewEval(object sender, GridViewRowEventArgs e)
{
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
      foreach (TableCell cell in e.Row.Cells)
      {
       if (cell.Text == "0") { cell.Text = "-"; }
      }
</code></pre>

<p>}
 }</p>

<p>It's currently in the code behind of a page and I'll be using it in other other pages. I would like to use the same code in other pages. When I cut and paste the function into a class, it's not working.</p>

<p>I'm sure it's simple but I can't figure it out.</p>

<p>Thanks.</p>
