Solved

gridview button

Posted on 2009-04-06
1
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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