Remove Anchor tag from grid while exporting Gridview to Excel in Asp 2.0
<p>I need some help. How  can we remove anchor tags() from gridview when exporting to Excel.</p>

<p>below is my code to prepare grid but I am still showing anchor tags on text in Excel page.</p>

<pre><code>private void PrepareGridViewForExport(Control gv)
    {
        LinkButton lb = new LinkButton();
        Literal l = new Literal();
        string name = String.Empty;

        for (int i = 0; i &lt; gv.Controls.Count; i++)

        {            
            if (gv.Controls[i].GetType() == typeof(HtmlAnchor))
            {
                l.Text = (gv.Controls[i] as HtmlAnchor).InnerText;
                gv.Controls.Remove(gv.Controls[i]);
                gv.Controls.AddAt(i, l);
            }
}
}
</code></pre>
