4

Possible Duplicate:
expose and raise event of a child control in a usercontrol in c#

I have user control with one html input button.

On page I am consuming that user control. How can I expose onclient event of that input button inside user control so if that button client so i can call page function.

<uc2:UC_LayoutSelector ID="UC_LayoutSelector1" runat="server" OnClientLayoutSelect="UC_LayoutSelector1_MyPageFunction" />

 <script type="text/javascript">

        function UC_LayoutSelector1_MyPageFunction(e) {
            alert(e);
        }
    </script>
Community
  • 1
  • 1
SOF User
  • 7,590
  • 22
  • 75
  • 121

1 Answers1

0

Depending on what you are trying to achieve, you may just want to create a public property of the onclient property of the input button. If you are trying to capture the moment when the user clicks that button, you will want to cause a postback with the javascript function and raise the event control programmatically. That will allow you to trap the event on the parent page.

angus
  • 690
  • 10
  • 26