Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7602533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:26:08+00:00 2026-05-30T23:26:08+00:00

i created a web application wherein i used the onrowcommand and created the handler

  • 0

i created a web application wherein i used the onrowcommand and created the handler in code behind, now i have a button inside the emptytemplate, whenever i click the button, my onRowCommand is not executed. Below is my code.

<asp:GridView ID="grdExternalLinkSection1" runat="server" Width="100%" AutoGenerateColumns="false" CellPadding="5" OnRowCommand="grdExternalLinkSection_RowCommand">
                                <EmptyDataTemplate>
                                    External Link Title
                                    <asp:TextBox ID="txtExternalLinkTitleEmptySection1" runat="server"></asp:TextBox>
                                    External Link Url
                                    <asp:TextBox ID="txtExternalLinkUrlEmptySection1" runat="server"></asp:TextBox>
                                    <asp:Button ID="btnExternalLinkEmptySection1" runat="server" Text="Add" CommandArgument="1" CommandName="headernew" style="padding:3px; width:56px;" />
                                </EmptyDataTemplate>
</asp:GridView>

there are more fields but this is what i am talking about. and here is my code behind handler for the RowCommand Event.

protected void grdExternalLinkSection_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Response.Write("welcome");
    }

it never excutes the handler, and below is my page directive:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewsletterASPVersion.ascx.cs" Inherits="RWO_Controls_NewsletterASPVersion" %>

this worked once, and after thereafter never working. does anyone have any idea what could be causing this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:26:09+00:00Added an answer on May 30, 2026 at 11:26 pm

    There are two possible traps that you might have fallen into:

    1. You are rebinding the GridView to it’s DataSource on every postback.
      So always check:

      if(!IsPostBack)BindGrid();
      
    2. You are not calling grdExternalLinkSection1.DataBind() when the DataSource is empty

    But then you would not see the EmptyDataTemplate at all. So i guess that you’ve fallen into the first trap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an ASP.NET Webforms web application which basically inetracts with the code
I have created a Web Application in asp.net 2.0. which is working fine on
We have created a web application, using ASP.NET, that allows users to upload documents
I have created a web application using Visualstudio 2008 using C# on my computer.
I have created a web application with a Silverlight project embedded in it, using
I've created a web application in asp.net. I've to generate embed code for one
I've created a web.py application, and now that it is ready to be deployed,
I have created a web application using Jersey and Dynamic Web Project of Eclipse.
My problem i sthat i have created a web application in visual studio 2008
I'm new to Servlet containers and have created a web application using Tomcat 6.0.26.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.