.NET to Javascript compiler

C# code   Html page   Start
class Buttons : UserControl
{
    internal Action Execute(string message)
    {
        return delegate()
        {
            HtmlWindow.Current.Alert(message);
        };
    }
}
<body j:type="ui:Buttons">
  <table cellpadding="4" cellspacing="0" class="propertyGrid">
    <thead>
      <tr>
        <th></th>
        <th>Enabled</th>
        <th>Disabled</th>
      </tr>
    </thead>
    <tbody>      
      <tr>
        <th>
          Text Button
        </th>
        <td>
          <span tabindex="1" j:control="buttons:ImageTextButton()
            {
              Text = 'Text Button',
              Execute = j:control.Execute('Text Button clicked')
            }"></span>
        </td>
        <td>
          <span tabindex="1" j:control="buttons:ImageTextButton()
            {
              Text = 'Text Button',
              Enabled = false,
              Execute = j:control.Execute('Text Button clicked')
            }"></span>

        </td>
      </tr>
      <tr>
        <th>
          Image Button
        </th>
        <td>
          <span tabindex="1" j:control="buttons:ImageTextButton()
            {
              Image = 'images/vacation.gif',
              Execute = j:control.Execute('Image Button clicked')
            }"></span>
        </td>
        <td>
          <span tabindex="1" j:control="buttons:ImageTextButton()
            {
              Image = 'images/vacation.gif',
              Enabled = false,
              Execute = j:control.Execute('Image Button clicked')
            }"></span>
        </td>
      </tr>
      <tr>
        <th>
          Image Text Button
        </th>
        <td>
          <span tabindex="1" j:control="buttons:ImageTextButton()
              {
                Image = 'images/vacation.gif',
                Text = 'Image Text Button',            
                Execute = j:control.Execute('Text Image Button clicked')
              }"></span>
        </td>
        <td>
          <span tabindex="1" j:control="buttons:ImageTextButton()
              {
                Image = 'images/vacation.gif',
                Text = 'Image Text Button',            
                Enabled = false,
                Execute = j:control.Execute('Image Text Button clicked')
              }"></span>
        </td>
      </tr>
      <tr>
        <j:variable name="toggleTextChecked" type="sys:Boolean"/>
        <th>
          Text Toggle
        </th>
        <td>
          <span tabindex="1" j:control="buttons:ToggleButton()
            {
              Text = 'Text Toggle',
              Execute = j:control.Execute('Text Toggle clicked'),
              Checked = j:variable.toggleTextChecked
            }"></span>
        </td>
        <td>
          <span tabindex="1" j:control="buttons:ToggleButton()
            {
              Text = 'Text Button',
              Enabled = false,
              Execute = j:control.Execute('Text Toggle clicked'),
              Checked = j:variable.toggleTextChecked
            }"></span>
        </td>
        <td style="visibility:hidden" j:control="controls:Control() { Element.Style.Visibility = jc:Operations.IsVisible(j:variable.toggleTextChecked) }">
          checked
        </td>
      </tr>
      <tr>
        <j:variable name="toggleImageChecked" type="sys:Boolean"/>
        <th>
          Image Toggle
        </th>
        <td>
          <span tabindex="1" j:control="buttons:ToggleButton()
            {
              Image = 'images/vacation.gif',
              Execute = j:control.Execute('Image Toggle clicked'),
              Checked = j:variable.toggleImageChecked
            }"></span>
        </td>
        <td>
          <span tabindex="1" j:control="buttons:ToggleButton()
            {
              Image = 'images/vacation.gif',
              Enabled = false,
              Execute = j:control.Execute('Image Toggle  clicked'),
              Checked = j:variable.toggleImageChecked
            }"></span>
        </td>
        <td style="visibility:hidden" j:control="controls:Control() { Element.Style.Visibility = jc:Operations.IsVisible(j:variable.toggleImageChecked) }">
          checked
        </td>
      </tr>
      <tr>
        <j:variable name="toggleImageTextChecked" type="sys:Boolean"/>
        <th>
          Image Text Toggle
        </th>
        <td>
          <span tabindex="1" j:control="buttons:ToggleButton()
            {
              Image = 'images/vacation.gif',
              Text = 'Text',
              Execute = j:control.Execute('Image Text Toggle clicked'),
              Checked = j:variable.toggleImageTextChecked
            }"></span>
        </td>
        <td>
          <span tabindex="1" j:control="buttons:ToggleButton()
            {
              Image = 'images/vacation.gif',
              Enabled = false,
              Text = 'Text',
              Execute = j:control.Execute('Image Text Toggle clicked'),
              Checked = j:variable.toggleImageTextChecked
            }"></span>
        </td>
        <td style="visibility:hidden" j:control="controls:Control() { Element.Style.Visibility = jc:Operations.IsVisible(j:variable.toggleImageTextChecked) }">
          checked
        </td>
      </tr>
      <tr>
        <j:variable name="checkbox" type="sys:Boolean"/>
        <th></th>
        <td>
          <span j:control="buttons:ToggleLabel() { Checked = j:variable.checkbox}">Check Box</span>
          <input type="checkbox" j:control="buttons:CheckBox() { Checked = j:variable.checkbox}"/>
        </td>
        <td>
          <span j:control="buttons:ToggleLabel() { Checked = j:variable.checkbox, Enabled = false}">Check Box</span>
          <input type="checkbox" j:control="buttons:CheckBox() { Checked = j:variable.checkbox, Enabled = false }"/>
        </td>
        <td style="visibility:hidden" j:control="controls:Control() { Element.Style.Visibility = jc:Operations.IsVisible(j:variable.checkbox) }">
          checked
        </td>
      </tr>
      <tr>
        <j:variable name="option1" type="sys:Int32?"/>
        <th></th>
        <td>
          <span j:control="buttons:OptionLabel&lt;sys:Int32?&gt;() { Key = 1, Value = j:variable.option1 }">Option 1</span>
          <input type="radio" j:control="buttons:OptionBox&lt;sys:Int32?&gt;() { Key = 1, Value = j:variable.option1 }"/>
          <span j:control="buttons:OptionLabel&lt;sys:Int32?&gt;() { Key = 2, Value = j:variable.option1 }">Option 2</span>
          <input type="radio" j:control="buttons:OptionBox&lt;sys:Int32?&gt;() { Key = 2, Value = j:variable.option1 }"/>
          <span j:control="buttons:OptionLabel&lt;sys:Int32?&gt;() { Key = 3, Value = j:variable.option1 }">Option 3</span>
          <input type="radio" j:control="buttons:OptionBox&lt;sys:Int32?&gt;() { Key = 3, Value = j:variable.option1 }"/>
        </td>
        <td>
          <span j:control="buttons:OptionLabel&lt;sys:Int32?&gt;() { Enabled = false, Key = 1, Value = j:variable.option1 }">Option 1</span>
          <input type="radio" j:control="buttons:OptionBox&lt;sys:Int32?&gt;() { Key = 1, Value = j:variable.option1, Enabled = false }"/>
          <span j:control="buttons:OptionLabel&lt;sys:Int32?&gt;() { Enabled = false, Key = 2, Value = j:variable.option1 }">Option 2</span>
          <input type="radio" j:control="buttons:OptionBox&lt;sys:Int32?&gt;() { Key = 2, Value = j:variable.option1, Enabled = false }"/>
          <span j:control="buttons:OptionLabel&lt;sys:Int32?&gt;() { Enabled = false, Key = 3, Value = j:variable.option1 }">Option 3</span>
          <input type="radio" j:control="buttons:OptionBox&lt;sys:Int32?&gt;() { Key = 3, Value = j:variable.option1, Enabled = false }"/>
        </td>
        <td j:control="controls:Control() { Element.InnerText = j:variable.option1.ToString() }">
        </td>
      </tr>    
    </tbody>
  </table>
</body>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="x-ua-compatible" content="IE=11;IE=10;IE=9;IE=8;IE=7" />
    <link rel="stylesheet" href="styles/jscriptsuite.css" type="text/css" />
    <link rel="stylesheet" href="styles/summary.css" type="text/css" />
    <script language="javascript" type="text/javascript" src="js/Buttons.js"></script>
	</head>
	<body onload="StartScript()">
		Buttons.html: Buttons control.
  </body>
</html>

© 2009 JScriptSuite. All rights reserved.