Microsoft Mediaroom Buttonclick event
<p>iam having a doubt regarding the TVButton control of mediaroom.there are events and actions which comes with mediaroom presentation framework.how can i call my own event handler for tvbutton in my code. 
onButtonClick="btnlogin_ButtonClick" is not working. if i write my custom code for void btnlogin_ButtonClick(object sender,EventArgs e){ } </p>

<p>onButtonClick is not firing!
 Sample code of mediaroom!</p>

<pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="SubmitAction_01_Designer.aspx.cs"
    Inherits="TVPage_TVPage_Submit" %&gt;

&lt;%@ Register Assembly="TVControls" Namespace="Microsoft.TV.TVControls" TagPrefix="mrml" %&gt;
&lt;%@ Register Assembly="TVControls" Namespace="Microsoft.TV.TVControls.Actions" TagPrefix="mrml" %&gt;
&lt;form id="form1" runat="server"&gt;
&lt;mrml:TVPage ID="TVPage1" runat="server" Style="position: absolute;"&gt;
    &lt;mrml:TVPanel ID="TVPanel2" runat="server" Background="image(file:/BG_Masthead.png)"
        Style="z-index: 102; left: 0px; width: 632px; position: absolute; top: 0px; height: 99px"&gt;
        &lt;mrml:TVImage ID="TVImage2" runat="server" Style="left: 16px; width: 260px; position: absolute;
            top: 23px; height: 80px" Url="file:///Brand_Service_Menu.png"&gt;
        &lt;/mrml:TVImage&gt;
        &lt;mrml:TVLabel ID="TVLabel3" runat="server" Background="@Transparent" Foreground="@TextHeader"
            HorizontalAlign="right" VerticalAlign="bottom" Padding="rect(0,0,0,0)" Style="left: 265px;
            width: 331px; position: absolute; top: 13px; height: 69px" Text="SubmitAction - Designer"
            Wrap="false"&gt;
        &lt;/mrml:TVLabel&gt;
    &lt;/mrml:TVPanel&gt;
    &lt;mrml:TVText ID="TVText1" runat="server" Style="position: absolute; top: 137px; left: 347px;"
        MaxChars="100"&gt;
    &lt;/mrml:TVText&gt;
    &lt;mrml:TVButton ID="TVButton1" runat="server" Style="position: absolute; top: 197px;
        left: 352px;" OnClick="SubmitAction0" Text="Click To submit"&gt;
    &lt;/mrml:TVButton&gt;
    &lt;mrml:TVActions ID="TVActions1" runat="server" Actions-Capacity="4"&gt;
        &lt;mrml:SubmitAction Gadgets="TVText1" Method="Get" Name="SubmitAction0" Target=""
            Url="SubmitAction_02_Designer.aspx" X="5" Y="5" /&gt;
    &lt;/mrml:TVActions&gt;
    &lt;mrml:TVLabel ID="TVLabel4" runat="server" Style="position: absolute; top: 137px;
        left: 67px; height: 158px; width: 246px;" Text="Enter some text in TVText and click on TVButton to submit the TVpage. When the TVPage is submitted,
the control goes to the next page where you can see the text entered in the previous page."&gt;
    &lt;/mrml:TVLabel&gt;
&lt;/mrml:TVPage&gt;
&lt;/form&gt;
</code></pre>

<p>So here we can only give  OnClick="SubmitAction0".  The above sample is the source view</p>

<p>The code behind sample:</p>

<pre><code>using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.TV.TVControls.Actions;
using Microsoft.TV.TVControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        /*        &lt;mrml:MoveAction Height="40" Left="270" Name="MoveAction0" Target="txtMove" 
            Top="138" Width="100" X="117" Y="117" /&gt;
        &lt;mrml:ShowAction Name="ShowAction0" Targets="lblShow" X="89" Y="89" /&gt;
        &lt;mrml:SetAction Name="SetAction0" PropertyName="value" PropertyValue="Set" 
            Target="txtSet" X="61" Y="61" /&gt;
        &lt;mrml:HideAction Name="HideAction0" Targets="lblHide" X="5" Y="5" /&gt;
        &lt;mrml:KeyAction Key="1" Name="KeyAction0" Target="txtKey" X="33" Y="33" /&gt;
        &lt;mrml:FocusAction Name="FocusAction0" Target="btnFocus" X="229" Y="100" /&gt;*/

        MoveAction objMove = new MoveAction("MoveAction0", "txtMove", 270, 138, 100, 40);
        TVActions1.Actions.Add(objMove);
        ShowAction objShow = new ShowAction("ShowAction0", "lblShow");
        TVActions1.Actions.Add(objShow);
        SetAction objSet = new SetAction("SetAction0", "txtSet", "value", "Set");
        TVActions1.Actions.Add(objSet);
        HideAction objHide = new HideAction("HideAction0", "lblHide");
        TVActions1.Actions.Add(objHide);
        KeyAction objKey = new KeyAction("KeyAction0", "txtKey", "1");
        TVActions1.Actions.Add(objKey);
        FocusAction objFocus = new FocusAction("FocusAction0", "btnFocus");
        TVActions1.Actions.Add(objFocus);

        TVButton1.OnClick = new Microsoft.TV.TVControls.Events.ClickEvent("ShowAction0");
        TVButton2.OnClick = new Microsoft.TV.TVControls.Events.ClickEvent("HideAction0");
        TVButton3.OnClick = new Microsoft.TV.TVControls.Events.ClickEvent("SetAction0");
        TVButton4.OnClick = new Microsoft.TV.TVControls.Events.ClickEvent("KeyAction0");
        TVButton5.OnClick = new Microsoft.TV.TVControls.Events.ClickEvent("FocusAction0");
        TVButton6.OnClick = new Microsoft.TV.TVControls.Events.ClickEvent("MoveAction0");

        //Following lines are for displaying the file name
        /*&lt;mrml:TVLabel ID="lblFileName" runat="server" 
                style="position: absolute; top: 69px; left: 9px; width: 241px;" Text="TVLabel"&gt;
            &lt;/mrml:TVLabel&gt;*/
        TVLabel lblFileName = new TVLabel();
        lblFileName.ID = "lblFileName";
        lblFileName.Left = 40;
        lblFileName.Top = 70;
        lblFileName.Width = 500;
        lblFileName.Text = HttpContext.Current.Request.FilePath;
        lblFileName.IsVisible = true;
        TVPage1.Controls.Add(lblFileName);
    }
}
</code></pre>
