can find ImageButton but can't find button

A

ad

I have a Button (named btnOK) and a ImageButton (named ImageButton1) in a
Template field of a GridView;
I use the codes below to find the Button and ImageButton, the ImageButton
can be found, but Button can't find.
Why?



protected void gvCheckSem_RowEditing(object sender, GridViewEditEventArgs
e)
{
Button btnOk = (Button)gvCheckSem.Rows[e.NewEditIndex].FindControl("btnOK");
ImageButton btn1 =
(ImageButton)gvCheckSem.Rows[e.NewEditIndex].FindControl("ImageButton1");

....
}
 
A

ad

I have verified again, I have set runat=serrver on btnOK.


Eliyahu Goldin said:
Make sure you have runat=server set by btnOK.

Eliyahu

ad said:
I have a Button (named btnOK) and a ImageButton (named ImageButton1) in
a Template field of a GridView;
I use the codes below to find the Button and ImageButton, the ImageButton
can be found, but Button can't find.
Why?



protected void gvCheckSem_RowEditing(object sender, GridViewEditEventArgs
e)
{
Button btnOk =
(Button)gvCheckSem.Rows[e.NewEditIndex].FindControl("btnOK");
ImageButton btn1 =
(ImageButton)gvCheckSem.Rows[e.NewEditIndex].FindControl("ImageButton1");

...
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top