in Education by
I am going through a ASP C# book and doing the tutorials. However I have encountered a problem. I have the following code that will list some events. EventTracker.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="EventTracker.aspx.cs" Inherits="EventTracker" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> Event Tracker h1 { font-size: large; }

Controls being monitored for change events:








List of events:


EventTracker.aspx.cs using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; public partial class EventTracker : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Log("<< Page_Load>>"); } protected void Page_PreRender(object sender, EventArgs e) { //Find the control ID of the sender. //This requires converting the Object type into a control class. string ctrlName = ((Control)sender).ID; Log(ctrlName + " Changed"); } protected void Log(string entry) { lstEvents.Items.Add(entry); //Select the last item to scroll the list so the most recent are visible lstEvents.SelectedIndex = lstEvents.Items.Count - 1; } } I am recieving the following error: Error 1 'ASP.eventtracker_aspx' does not contain a definition for 'CtrlChanged' and no extension method 'CtrlChanged' accepting a first argument of type 'ASP.eventtracker_aspx' could be found (are you missing a using directive or an assembly reference?) I am new to ASP and would like to understand why such an error is occurring so in future reference I know what is causing it. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
In your markup you have OnCheckedChanged="CtrlChanged" But there is no event handler with that name / matching signature in your codebehind... This event will be triggered everytime your CheckBox changes, but you do not have anything in the code that will respond. You need something like protected void CtrlChanged(object sender, EventArgs e) { // do something }

Related questions

0 votes
    We have redesigned the structure to a website which has several business units. Now I want to redirect (301 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    I'm using restful routing module for asp.net mvc and very happy with it. But I can't get one ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I am using C#.Net to send out a HTML email which contains embedded images. These emails work fine ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I am using C#.Net to send out a HTML email which contains embedded images. These emails work fine ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    MSDN: Every Visual Basic application must contain a procedure called Main. I... Didn't find such a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    Which of the following packages does not contain in base R system? (a) utils, graphics (b) mesh, ... Started of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    In .NET 4 beta 2, there is the new Numerics namespace with struct BigInteger. The documentation states that it is an ... = BigInteger.One; BigInteger b = BigInteger.One; while (b...
asked May 24, 2022 in Education by JackTerrance
0 votes
    In .NET 4 beta 2, there is the new Numerics namespace with struct BigInteger. The documentation states that it is an ... = BigInteger.One; BigInteger b = BigInteger.One; while (b...
asked May 8, 2022 in Education by JackTerrance
0 votes
    I have a datagridview that I'm using in Visual Studio 2008 for a winforms app. The datagridview is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a datagridview that I'm using in Visual Studio 2008 for a winforms app. The datagridview is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
+1 vote
    Does a built-in header file contains built-in function definition in C-Programming?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    What does an interface contain? (a) Method definition (b) Method declaration (c) Method declaration and definition ... Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    What does an interface contain? (a) Method definition (b) Method declaration (c) Method declaration and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What does a History object contain? (a) URL (b) Parameters (c) Attribute values (d) Property This ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
...