Link to home
Start Free TrialLog in
Avatar of Angela4eva
Angela4eva

asked on

Getting gridview column value in button click

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                            AllowSorting="True" OnPageIndexChanging="GridView2_PageIndexChanging" OnSorting="GridView2_Sorting"
                            PageSize="2">
                            <Columns>
<asp:BoundField DataField="Fnumber" HeaderText="Fnumber" />
    <asp:TemplateField >
                                    <ItemTemplate>
                                        <asp:linkbutton" runat="server" > 
                                    </ItemTemplate>
                                    <ItemStyle Width="120px" />
</Columns>

</GridView>

I want to write onclick code for link button and get the value of  Fnumber.
Please help
Avatar of Mrunal
Mrunal
Flag of India image

Hi,
Its very easy.
You can go to design view and then go to edit template for that gridview.
You will get link button there. Just double-click on that.

you will get click event automatically generated.

Hope this helps you.
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angela4eva
Angela4eva

ASKER

thanks