<gl****@gmail.comwrote in message
news:e1**********************************@g30g2000 hsb.googlegroups.com...
On Nov 26, 2:42 am, Siva M <shiva...@online.excite.comwrote:
>Using PostbackUrl property:
<asp:ImageButton runat="server" ID="ib" ToolTip='<%# Eval("ID") %>'
PostBackUrl='<%# "EditPage.aspx?ID=" + Eval("ID") %>' />
Hope this helps?
"glb...@gmail.com" wrote:
Hi.
I have a gridview in which each row has an image button attached. I
have each button in each row set up to be associated with a DB field.
When I hover above the button it shows me the correct value of the DB
field in a tooltip, so there is no problem there. But ...how do I
access that value? When the user clicks that button I will redirect
him to a new page and I need to use the value as an ID in a
querystring, but cannot figure out how to retrieve it. Everything
else (except optaining the value) works fine. I searched online but
cannot find the answer.
Any help?
Thanks,
Steve- Hide quoted text -
- Show quoted text -
Siva,
That would work on an image button, but I need it to work on a
Gridview's button control: <ASP:BUTTONFIELD BUTTONTYPE="Image"
Any ideas on that?
Thanks,
Steve
The RowCommand autopostback has the row number (e.CommandArguement) and you
can use that to access a cell that has the id as in
GridView1.Rows[nRow].Cells[nCell].Text Sometimes instead of finding a
control that holds the id it is easier to just add the id as an extra column
and use the css style to hide it since it is not used except to make the id
easier to get access to.
If you want to do this on the client side and avoid a postback then during
the RowDataBound you can add something like
strVal = " WHERE id=" + e.Row.Cells[vFieldNum].Text;
e.Row.Cells[nFieldNum].Attributes.Add("onclick", "return
LaunchInfo('./DetailLocation.aspx?sqlDetail=" + strVal+ "\')");
However, it would seem that what Siva suggested should work also
--
================================================== ====================
Joseph "Beemer Biker" Stateson
http://ResearchRiders.org Ask about my 99'R1100RT
================================================== ====================
: