This project is read-only.

C# jQuery Wrapper. Helps you to write correct jQuery functions in c# language. The code you write will be traduced into correct jQuery methods calls.


This is a simple way to write jQuery statments using c# language.
You can use this library server side in Standard Asp.Net and in MVC (all versions).

Some examples (only to show code translation):

Server side:

 <script language="javascript" type="text/javascript">

    function test()
    {
    <%= jq.Select(
          sel.Element("a") | 
          sel.Element("button").even() | 
          sel.Class("animatedobject").animated() | 
          sel.Id("id4").first_child()) %>
    }

    function test2()
    {
    
    }

    <%= jq.Select(sel.el_button).attr("myattribute", "ole") %>
    <%= jq.Select(sel.Class("myclass").even() | 
                  sel.el_button.animated()).val("djjd").height("34").animate("thisobject",Duration.fast).fadeTo(0d,0d) %>
          
    <%= jq.Function(() => jq.Select(sel.All).stop()) %>
    <%= jq.Select(sel.All).toggle(jq.Function(() => jq.Select(sel.el_button.animated()).show())) %>
    <%= jq.Select(sel.All).bind("Click",new {property1="hello", prop2="@test"}, jq.Function( () => jq.Invoke("test"))) %>

    </script>
  </div>





Server side (using Razor):

 <script language="javascript" type="text/javascript">

    function test()
    {
    @(jq.Select(
          sel.Element("a") | 
          sel.Element("button").even() | 
          sel.Class("animatedobject").animated() | 
          sel.Id("id4").first_child()))
    }

    function test2()
    {
    
    }

     @jq.Select(sel.el_button).attr("myattribute", "ole")
     @jq.Select(sel.Class("myclass").even() | sel.el_button.animated()).val("djjd").height("34").animate("thisobject",Duration.fast).fadeTo(0d,0d)
          
    @jq.Function(() => jq.Select(sel.All).stop()) 
    @jq.Select(sel.All).toggle(jq.Function(() => jq.Select(sel.el_button.animated()).show())) 
    @jq.Select(sel.All).bind("Click",new {property1="hello", prop2="@test"}, jq.Function( () => jq.Invoke("test"))) 

    </script>
  </div>





Client Side:

<body>
  <div>
   <script language="javascript" type="text/javascript">
 
    function test()
    {
    $('a,button:even,.animatedobject:animated,#id4:first-child')
    }
 
    function test2()
    {
    
    }
 
 
    
    $(':button').attr("myattribute","ole")
    $('.myclass:even,:button:animated').val("djjd").height("34").animate("thisobject","fast").fadeTo("0","0")
          
     function (){$('*').stop()}
    $('*').toggle( function (){$(':button:animated').show()})
    $('*').bind("Click",{property1:'hello',prop2:test}, function (){test()})
 
    </script>
  </div>
</body>




Contact us at www.teamdev.it
Via twitter : http://twitter.com/TeamdevPerugia

Last edited Dec 2, 2010 at 2:15 PM by TeamDev, version 11