473,414 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

can find ImageButton but can't find button

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");

....
}
Nov 20 '05 #1
2 1383
Make sure you have runat=server set by btnOK.

Eliyahu

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:Oq**************@TK2MSFTNGP09.phx.gbl...
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");

...
}

Nov 20 '05 #2
ad
I have verified again, I have set runat=serrver on btnOK.
"Eliyahu Goldin" <re*************@monarchmed.com> ¼¶¼g©ó¶l¥ó·s»D:ug**************@TK2MSFTNGP12.phx.g bl...
Make sure you have runat=server set by btnOK.

Eliyahu

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:Oq**************@TK2MSFTNGP09.phx.gbl...
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");

...
}


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chuck Hartman | last post by:
I've been trying to add an ImageButton object to a Calendar table cell, but so far I am unable to handle the Command event from that button in my form's code behind. Below is an example of what I...
3
by: Benjamin Gavin | last post by:
Hi all, I recently stumbled upon a bug in the ASP.NET framework handling of ImageButton based postbacks. The issues derives from the fact that IE and Mozilla handle the case of a missing image...
3
by: tshad | last post by:
I was trying to change my asp:button to asp:ImageButton, but got a message saying that ImageButton does not have an onClick function. How do I get the ImageButton call a function? Thanks, ...
1
by: Nathan Sokalski | last post by:
I want to create a pushbutton-like control on my webform that has an image on it. I used to think that this is what the ImageButton control was, but it seems to me that the ImageButton is nothing...
1
by: MattB | last post by:
I have a button column in a datagrid that is the delete button. Right now it is just a text link. When I go into the Property Builder My button choices are only LinkButton or PushButton. I'd like...
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
0
by: Oddball | last post by:
I have set up a page with uses two lots of image buttons, one for a collection and one for more images from that collection. I generate all the image buttons on page init (I know, but I...
2
by: dperren | last post by:
At current, I have a set of dynamically generated image buttons, which are created with this (excert) of code: TableCell tasks = new TableCell(); while (reader.Read()) { ...
4
by: suzanne.boyle | last post by:
Hi, I'm adding an ImageButton as a child to a custom web control and attaching an event handler to it. When the page posts back the event is not being fired however. I initially assumed I had...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.