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

  • SEARCH
  • Home
  • 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 6940451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:45:15+00:00 2026-05-27T12:45:15+00:00

What do you think causes events (of any control, textbox, button, etc) in webforms

  • 0

What do you think causes events (of any control, textbox, button, etc) in webforms to not fire? What are the things that need to be checked and considered when creating such an event?

Consider this code:

<%@ Page Language="C#" MasterPageFile="~/App_Theme/TranByEmployeeMaster.master" AutoEventWireup="true"
    CodeFile="ProcessEmployeePenalty.aspx.cs" Inherits="Transactions_ProcessEmployeePenalty"
    Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:GridView ID="gvEmployees" runat="server" HeaderStyle-CssClass="HeaderStyle"
        RowStyle-CssClass="RowStyle" AlternatingRowStyle-CssClass="AlternatingRowStyle"
        FooterStyle-CssClass="FooterStyleGrid" EmptyDataRowStyle-BackColor="White" AutoGenerateColumns="False"
        EmptyDataText="No result were found." ShowFooter="true" DataKeyNames="EmployeePenaltyID">
        <Columns>
            <asp:TemplateField HeaderText="No.">
                <ItemTemplate>
                    <asp:Label ID="lblNo" runat="server" Text='<%# gvEmployees.Rows.Count + 1 %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Update">
                <ItemTemplate>
                    <asp:ImageButton ID="btnUpdateEmployeeGrid" runat="server" ImageUrl="~/App_Resources/images/content/Edit.gif"
                        CommandName="Update" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:ImageButton ID="btnDeleteEmployeeGrid" runat="server" ImageUrl="~/App_Resources/images/content/Delete.png"
                        CommandName="Delete" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:ButtonField HeaderText="EmployeeID" DataTextField="EmployeeID" />
            <asp:ButtonField HeaderText="Penalty Nature" DataTextField="PenaltyNature" />
            <asp:ButtonField HeaderText="Penalty Description" DataTextField="PenaltyDescription" />
            <asp:ButtonField HeaderText="Penalty Amount" DataTextField="PenaltyAmount" />
        </Columns>
    </asp:GridView>
    <%--<asp:Button ID="btnAddPenalty" runat="server" Text="Add Penalty" OnClick="btnAddPenalty_Clicked"
                OnClientClick="return confirm('Are you certain to post the selected cutoff?');" />--%>
    <asp:ImageButton ID="btnAddPenalty" runat="server" SkinID="Add" OnClick="btnAddPenalty_Clicked" />
    <asp:DropDownList ID="sample" runat="server" AutoPostBack="true" OnSelectedIndexChanged="sample_selected">
        <asp:ListItem Value="0" Text="Sample0" />
        <asp:ListItem Value="1" Text="Sample1" />
        <asp:ListItem Value="2" Text="Sample2" />
    </asp:DropDownList>
    <asp:Panel ID="pnlPopUp" runat="server">
        <table>
            <tr>
                <td>
                    <asp:Label ID="lblsample" runat="server" Text="Employee : " />
                </td>
                <td>
                    <asp:DropDownList ID="ddlEmployees" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Penalty Nature : " />
                </td>
                <td>
                    <asp:TextBox ID="tbxPenaltyNature" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Penalty Description : " />
                </td>
                <td>
                    <asp:TextBox ID="tbxPenaltyDescription" runat="server" TextMode="MultiLine" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="Penalty Amount : " />
                </td>
                <td>
                    <asp:TextBox ID="tbxPenaltyAmount" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnClose" runat="server" Text="Close" />
                </td>
                <td>
                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Clicked" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Label ID="lblDummy" runat="server" />
    <ajax:ModalPopupExtender ID="MP" runat="server" TargetControlID="lblDummy" PopupControlID="pnlPopUp"
        CancelControlID="btnClose">
    </ajax:ModalPopupExtender>
</asp:Content>

protected void btnAddPenalty_Clicked(object sender, EventArgs e)
    {
        MP.Show();
    }

I do have master page on this page but i can’t see a reason why this code does not fire the onclicked event. I only want to click and Imagebutton then a modalpopup(ajax control) to appear with certain fields to be filled up then click submit and save it to the database but onclicked event does not fire and also the postback in page_load event of the page is not firing either.

  • 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-27T12:45:16+00:00Added an answer on May 27, 2026 at 12:45 pm

    Events follows publisher-subscriber mechanism. Control/object always raise (fire) the events as per implementation. The question is whether a handler is attached or not. So if you are interested to subscribe the event then you must have to attach an event handler to that event.

    Take a look at MSDN article – Raising an Event and Events (C# Programming Guide).

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

Sidebar

Related Questions

I need to make a control with popping out menu and button that causes
I think the file that is produced is an .asm file, any idea how
I have a button on an ascx control that calls a method on the
1.. Is there any performance overhead caused by the usage of attributes? Think for
I think that java executables (jar files) are trivial to decompile and get the
I have created a WinForms user control that is a set of five cascading
I want to write an application that gets events on every file change on
I need to queue events and tasks for external systems in a reliable/transactional way.
I would like to make a custom button, that will display 3 data bound
I have a TextBox control in a form which is still pulling in data

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.