Event created in user control not working

event handling , asp.net , Event not working custom event , user control India
  • 6 years ago

    //linkmenu.ascx 02
    03 <%@ Control Language="C#" Au.... 04
    05 LinkButton 06
    07
    08
    09 //linkmenu.ascx.cs 10
    11 ........ 12 public EventHandler LinkClicked; 13 ..... 14 protected void LinkButton1_Click(object sender, EventArgs e) 15 { 16 // One of the LinkButton controls has been clicked. 17 // Raise an event to the page. 18 if (LinkClicked != null) 19 { 20 LinkClicked(this, EventArgs.Empty); 21 } 22 } 23
    24
    25 //wizard.aspx 26
    27 <%@ Page Language="C#" Au...... 28 <%@ Register src="linkmenu........ 29
    30 ....... 31 32
    33
    34
    35 //wizard.aspx.cs 36 ..... 37 protected void LinkClicked(object sender, EventArgs e) 38 { 39 Label1.Text = "Click detected."; 40 }

    The event LinkClicked in wizard.aspx.cs is not getting hit when the user control link button is clicked can any one tell where i have done wrong.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov