<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:at="http://www.sixapart.com/ns/at"
    xmlns:icbm="http://postneo.com/icbm"
    xmlns:rvw="http://purl.org/NET/RVW/0.2/"
    xmlns:media="http://search.yahoo.com/mrss">
    <channel>
        <title>Life, Opportunity, and Development</title>
        <link>http://cyberkruz.vox.com/library/posts/tags/javascript/page/1/</link>
        <description>[witty comment]</description>
        <language>en</language>
        <generator>Vox</generator>
        <lastBuildDate>Mon, 07 Apr 2008 03:40:31 -0600</lastBuildDate>
        <copyright>Copyright 2008</copyright>
        <docs>http://blogs.law.harvard.edu/tech/rss</docs> 
        <category domain="http://cyberkruz.vox.com/tags/">javascript</category>  
 
        <item>
            <title>Intellisense for jQuery</title>
            <link>http://cyberkruz.vox.com/library/post/intellisense-for-jquery.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Matthew Kruskamp)</author>
            <comments>http://cyberkruz.vox.com/library/post/intellisense-for-jquery.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://cyberkruz.vox.com/library/post/intellisense-for-jquery.html?_c=feed-rss-full</guid> 
            <pubDate>Mon, 07 Apr 2008 03:40:31 -0600</pubDate>         
            
            <description>    &lt;p&gt;Post your methods for getting intellisense in jQuery. So far, this is the best I have found.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://lancefisher.net/blog/archive/2008/02/12/intellisense-for-jquery-in-visual-studio-2008.aspx&quot;&gt;http://lancefisher.net/blog/archive/2008/02/12/intellisense-for-jquery-in-visual-studio-2008.aspx&lt;/a&gt;&lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://cyberkruz.vox.com/library/post/intellisense-for-jquery.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a00c2251f2742604a00f48cec20f30002?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description> 
            <category domain="http://cyberkruz.vox.com/tags/">javascript</category> 
            <category domain="http://cyberkruz.vox.com/tags/">jquery</category>   
        </item> 
 
        <item>
            <title>Calling C# Code from JavaScript</title>
            <link>http://cyberkruz.vox.com/library/post/calling-c-code-from-javascript.html?_c=feed-rss-full</link>   
            <author>nobody@vox.com(Matthew Kruskamp)</author>
            <comments>http://cyberkruz.vox.com/library/post/calling-c-code-from-javascript.html?_c=feed-rss-full</comments>
            <guid isPermaLink="true">http://cyberkruz.vox.com/library/post/calling-c-code-from-javascript.html?_c=feed-rss-full</guid> 
            <pubDate>Wed, 06 Feb 2008 13:27:23 -0700</pubDate>         
            
            <description>    &lt;p&gt;
Every once in a while people want to call their server-side code from
JavaScript. I ran into this particular difficulty myself to find that
many people online (including inside the msdn forums) say that this
cannot be done. Well I hope it hasn&amp;#39;t led too many people astray as I
am going to demonstrate it here. So first thing is first: &lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Create a new Website (It doesn&amp;#39;t even have to be an AJAX-Enabled Website)&lt;/li&gt;&lt;li&gt;Open the Default.aspx Page and change it to the following:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;div style=&quot;background: white none repeat scroll 0% 50%; font-size: 8pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: Courier New;&quot;&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;lt;%@ Page&amp;#160;&amp;#160; Language=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;C#&amp;quot;&lt;/span&gt; AutoEventWireup=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&amp;#160; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; CodeFile=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;Default.aspx.cs&amp;quot;&lt;/span&gt; Inherits=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;_Default&amp;quot;&lt;/span&gt; %&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;lt;!DOCTYPE html PUBLIC &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot;&lt;/span&gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&lt;/span&gt;&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;lt;html xmlns=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt; &amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;lt;head runat=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; Calling C# from JavaScript 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;lt;script type=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; function RecieveServerData(arg, context) 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; { 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; Message.innerText = arg; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; } 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160;  
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;lt;form id=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;form1&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;div&gt; 
&lt;/div&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;lt;input type=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;button&amp;quot;&lt;/span&gt; value=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;Callback&amp;quot;&lt;/span&gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; onclick=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;CallServer(&amp;#39;Calling From Button&amp;#39;, null)&amp;quot;&lt;/span&gt; /&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;lt;span id=&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;Message&amp;quot;&lt;/span&gt;&amp;gt; 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;/p&gt;&lt;/div&gt; 

&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160;  
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;br /&gt;&lt;div style=&quot;background: white none repeat scroll 0% 50%; font-size: 8pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: Courier New;&quot;&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;Now for the code-behind:&lt;/p&gt;&lt;p style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;div style=&quot;background: white none repeat scroll 0% 50%; font-size: 9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: Courier New;&quot;&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Data;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Configuration;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Web;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Web.Security;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Web.UI;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Web.UI.WebControls;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Web.UI.WebControls.WebParts;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Web.UI.HtmlControls;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;_Default&lt;/span&gt; : System.Web.UI.&lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;Page&lt;/span&gt;,
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;ICallbackEventHandler&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
{
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; fromClient;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; Fired when the page loads. Creates &lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; JavaScript to connect to the server.&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Page_Load(
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: rgb(43, 145, 175);&quot;&gt;EventArgs&lt;/span&gt; e)
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; {
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// Get javascript function from the&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// server that is capible of connecting&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// to our server. RecieveServerData is&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// the javascript method we will call when&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// we are done processing the data&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; reference = 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.ClientScript.GetCallbackEventReference(
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;arg&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;RecieveServerData&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;);
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// Generate the javascript that can connect&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// to the server&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; callBackScript =
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;@&amp;quot;&amp;#160;&amp;#160; function CallServer(arg, context)&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; {&amp;quot;&lt;/span&gt; + reference + &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;;}&amp;quot;&lt;/span&gt;;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;// Put the javascript on the page&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.ClientScript.RegisterClientScriptBlock(
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.GetType(), &lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&amp;quot;CallServer&amp;quot;&lt;/span&gt;, 
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &amp;#160;&amp;#160; callBackScript, &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;);
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; }
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; This is the method called by the &lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; javascript. Here you can do some server&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; processing to manage what you are going&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; to give back to the client if anything.&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; RaiseCallbackEvent(
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; eventArgument)
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; {
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: green;&quot;&gt;/* Im saving stuff here */&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.fromClient = eventArgument;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; }
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; This is the method that passes back&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; to the javascript.&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: gray;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: gray;&quot;&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; GetCallbackResult()
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; {
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; &amp;#160;&amp;#160; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.fromClient;
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
&amp;#160;&amp;#160; }
&lt;/p&gt;
&lt;p style=&quot;margin: 0px;&quot;&gt;
}&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p&gt;
And that is it. Run it and you will be sending information to the
server, processing it, and sending the information back to the client.
How does it work? The ICallbackEventHandler interface defines the
contract allowing the javascript to connect to it. The registration in
the Page_Load() generates javascript capible of connecting to the
server, and the rest is your server-side code. This functionality is
not limited to pages as well. As long as you can access the page to do
the script registration, you can create server-side code that can be
connected to by client-side javascript.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;
This is very useful, but be aware of the security risks involved. Always make sure to validate the input. Hope this helps.&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;background: white none repeat scroll 0% 50%; font-size: 9pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: Courier New;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div style=&quot;background: white none repeat scroll 0% 50%; font-size: 8pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: Courier New;&quot;&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;/p&gt;    &lt;p style=&quot;clear:both;&quot;&gt; 
    &lt;a href=&quot;http://cyberkruz.vox.com/library/post/calling-c-code-from-javascript.html?_c=feed-rss-full#comments&quot;&gt;Read and post comments&lt;/a&gt;   |   
    &lt;a href=&quot;http://www.vox.com/share/6a00c2251f2742604a00e398da03df0004?_c=feed-rss-full&quot;&gt;Send to a friend&lt;/a&gt; 
&lt;/p&gt;
 
            </description> 
            <category domain="http://cyberkruz.vox.com/tags/">javascript</category> 
            <category domain="http://cyberkruz.vox.com/tags/">c#</category> 
            <category domain="http://cyberkruz.vox.com/tags/">asp.net</category>   
        </item> 
    </channel>
</rss>

