Solved

gridview button

Posted on 2009-04-06
1
168 Views
Last Modified: 2013-12-17
Hi,

I have a grid view and a custom button like so

       <asp:TemplateField HeaderText="View">
            <ItemTemplate>
                <asp:Button ID="bthView" runat="server" Text="View" OnClick="cmdView" />
            </ItemTemplate>
            </asp:TemplateField>

then in the backend c# I am trying to wire it up as so

    protected void cmdView_Click(object sender, EventArgs e)
    {
        txtHeading.Text = "test";
   
    }

but this wont work so wht am i missing please help

Thanks,

R8VI
0
Comment
Question by:R8VI
1 Comment
 
LVL 5

Accepted Solution

by:
mrcoolcoder earned 500 total points
ID: 24082926
Try this markup:

     <asp:TemplateField HeaderText="View">
            <ItemTemplate>
                <asp:Button ID="bthView" runat="server" Text="View" OnClick="cmdView_Click" />
            </ItemTemplate>
            </asp:TemplateField>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now