Hi there first try it as it is once the issue is fixed than only create the Method 1 like getId ok as after once visibled false we didnt code like visible=true so the issue occured. Please update ur code to make the link visible like follow.
if (GridView1.Rows.Count > 0)
{
foreach (GridViewRow gvr in GridView1.Rows)
{
mailto += gvr.Cells[0].Text + "," + gvr.Cells[1].Text + ",";
cc += gvr.Cells[2].Text + "," + gvr.Cells[3].Text + ",";
}
mailto = mailto.Substring(0, mailto.Length - 1);
cc = cc.Substring(0, cc.Length - 1);
HyperLink1.NavigateUrl = "mailto:" + mailto + "?CC=" + cc;
HyperLink1.Visible = true;
}
else
{
HyperLink1.NavigateUrl = "mailto:";
HyperLink1.Visible = false;
}
And whatever issue u r getting in getId Method is just because u r not declare else ..declare else and code just return ""; the error would be killed.