This page shows integration with jQuery. The callback function also works as a lambda.

Output
jquerytest.png

ASPX page
<div class="empty" style="border: 1px solid red;"></div>
<div class="empty" style="border: 1px solid blue;"></div>
<div class="notempty" style="border: 1px solid green;">
	<div style="border: 1px solid purple;"></div>
</div>
    
<asp:Button runat="server" ID="btnRun" Text="Run" OnClientClick="HtmlTheDivs(); return false;" />
<axial:WFScript runat="server" ID="wfsHTD" MethodName="HtmlTheDivs" />


Codebehind
public void HtmlTheDivs()
{
	JQuery.jQuery("div.empty").html("in a div");
	JQuery.get("viaajax.txt", "", (response) => { JQuery.jQuery("div.empty:first").html((string)response); });
	JQuery.jQuery("div.notempty").children().html("when two divs love each other very much...");
	JQuery.jQuery("div.notempty").children().css("padding", "3px");
	JQuery.jQuery("div.notempty").children().each(AlertPadding);
}

public void AlertPadding()
{
	Window.Alert(JQuery.This.css("padding"));
}

Last edited Aug 5, 2008 at 8:46 PM by thasmin, version 2

Comments

No comments yet.