Solved

gridview button

Posted on 2009-04-06
1
173 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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 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