views:

270

answers:

1

Hi

I feel this is stupid, but what the hell...

this is two lines of a methods that handles a dropdownlist event:

        resolve = (Button)FormView1.FindControl("btn_resolve");
        resolve.Visible = true;

It used to work with me earlier! Not working now

+1  A: 

you need to use formview Databound event like

 protected void FormView1_DataBound(object sender, EventArgs e)
{
    if (FormView1.CurrentMode == FormViewMode.Edit)
    {
        btn_resolve = (Button)FormView1.FindControl("btn_resolve");
        resolve.Visible = true;
    }
}
Muhammad Akhtar
Thanks Mo,I just that by adding a databound event to formview and also changed the if statement according to my algorithm
Shankarooni