title: Creating a clicked event on ascx control when pressed
body: <p>I have a question about creating and managing events inside an ascx custom web control.</p>
  
  <p>I have created a very stupid control consisting in a div containing a asp:Label control, it is a very simple structure:</p>
  
  <pre><code>&lt;div id="mydiv" runat="server"&gt;
       &lt;asp:Label id="mylabel" text="Text"... /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>That is, very simple.
  I would like to add an event: clicked. I want to let the user add this control on the page and attach handlers to this event so that when this control is clicked it is possible to do something. It might seem a strange solution, it's like i'm trying to invent again the button control, that is: my custom button.
  Well to fire the event I would like to add a javascript in my div and call a js function that calls, using ajax mechanism, a server side function.
  Well how to call a server side function from here. I posted a question about how to call a server side function from a client side one and got some answers (many of them told me to use PageMethods), well it seems that pagemethod does not work, it compiles but when running and clicking on my control and executing the js (in the line PageMethods.mymethod()) here I have an error --> Java script exception: unrecognized method. It seems not finding the PageMethod.</p>
  
  <p>Well, considering my objective, how can I do?
  Ah, a solution like: use the click event in the label is not what I want because the click event must fire when I click in the div, consider that I might set a large padding so that a large empty space can provide a large clickable area.</p>
  
  <p>Thanks in advance.</p>