Hi there, I hope your appreciated help.
First of all I must say that I am a newbie when it comes to net language.

This is my problem:

I need show the `TemplateField` in `GridView` of my net page only when the Request.Cookies["MyCookie"] is not 'null' and have `1` value.

I follow this approch: would be to give a HeaderText for TemplateField, say Image, and then find using that and try this code.

I don't have error but the `TemplateField` Image is always visible.

Can you hep me?

Can you help me? thank you in advance.
Your help would be very appreciated


public void Page_Load (Object sender, EventArgs e)
{
if (Request.Cookies["MyCookie"] != null)
{
string fld = Request.Cookies["MyCookie"].Value;
Response.Write("Hello ...
");
Response.Write(fld + "
");
}

}


protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{

(
(DataControlField)GridView1.Columns
.Cast()
.Where(fld => fld.HeaderText == "Image")
.SingleOrDefault()
).Visible = false;
}






ImageUrl="/Images/edit.gif" ToolTip="edit"
OnClientClick="return confirm('Confirm?.');" />



ImageUrl="/Images/update.gif" ToolTip="update"
OnClientClick="return confirm('Confirm?.');" />

ImageUrl="/Images/delete.gif" ToolTip="delete"
OnClientClick="return confirm('Confirm?.');" />