Rewrite URL to a more meaningful URL - C#
<p>I am pulling in some URLs from following SQL table with following columns:</p>

<ul>
<li>Name - Contains the Name of site</li>
<li>URL - Contains the URL of site</li>
</ul>

<p>I am then generating dynamic HyperLinks and attaching them to a gridview column:</p>

<pre><code>protected void grdReport_Bnd(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        e.Row.Cells[1].Visible = false;
        e.Row.Cells[2].Visible = false;


        string qry = e.Row.Cells[2].Text;   // Pulling the URL
        string username = (string)Session[Constants.AssociateID];  // Pulling associate ID frpm session.
        string qry1 = qry + "?ID=" + username;   // Passing the associate ID to the URL
        string txt = e.Row.Cells[1].Text.ToString();   // Pulling the text to display on hyperlink.

        HyperLink lnk = new HyperLink();
        lnk.Text = txt;
        lnk.NavigateUrl = qry1;
        lnk.Attributes.Add("Border", "0");
        lnk.Attributes.Add("Target", "_blank");
        e.Row.Cells[3].Controls.Add(lnk);
    }
}
</code></pre>

<p>Now I need to hide this resultant URL. For example the URL at the hyperlink may be: <code>http://1.20.40.40:8050/?ID=123456</code> which should be displayed as <code>http://mysite.com/ABC</code> where <code>abc</code> is the text from hyperlink and <code>mysite.com</code> is the site where this hyperlink is getting displayed.</p>

<p>I have seen various examples but could not understand them.</p>
