How to get an ID from DetailView Control and Pass it as QuerySting
<p>How can I get the ID in a DetailView control and pass it as a query string in the URL?  Here is how the URL look like now in the email:
"http://localhost:49609/ABC/Home/NewPage.aspx"
I would like to get it like this once the email is sent out:
"http://localhost:49609/ABC/Home/NewPage.aspx?ID=298"
Pls. note the ID should come from the DetailView and it is in edit mode.  I have spent so many hours on this and was keep getting all kind of error so anyhelp will be appreciated.  Thanks.
Here is what i have so far...</p>

<pre><code>   //Create instance of main mail message class.
        System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage();     
        mailMessage.From = new System.Net.Mail.MailAddress(System.Configuration.ConfigurationManager.AppSettings["fromEmailAddress"]);
        mailMessage.To.Add(new System.Net.Mail.MailAddress("test@premierinc.com"));  
        mailMessage.Priority = System.Net.Mail.MailPriority.High;
        mailMessage.IsBodyHtml = false;    
        string myURI = HttpContext.Current.Request.Url.AbsoluteUri.ToString();   
        string mySubURI = myURI.Replace("OldPage.aspx", "NewPage.aspx");    
        mailMessage.Body = "Hello, here is the email." + Environment.NewLine + "Please click the link below to see more details.Thanks " + " " + Environment.NewLine + mySubURI;     
        mailMessage.Subject = "My Subject...";       
        System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient();      
        try
        {
            smtpClient.Send(mailMessage);
        }
        catch (System.Net.Mail.SmtpException smtpExc)
        {
            //Log error information on which email failed.
        }
        catch (Exception ex)
        {
            //Log general errors
        }
    }
</code></pre>
