<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4038426501825000627</id><updated>2011-04-21T10:48:46.350-07:00</updated><category term='AJAX'/><category term='space flight; hobby;'/><title type='text'>Really No Use</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://reallynouse.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4038426501825000627/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://reallynouse.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gary</name><uri>http://www.blogger.com/profile/10199801609079544944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_syPXDyqueDc/STd8egiMZZI/AAAAAAAAAAM/tQ2vyyA0kdM/S220/panda2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4038426501825000627.post-828280410595278576</id><published>2008-11-22T00:07:00.000-08:00</published><updated>2008-12-05T21:13:34.231-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='space flight; hobby;'/><title type='text'>Space flight</title><content type='html'>Recently I watched a talk by Charles Simonyi about his space flight in 2007. The talk was given in University of Washington and they graciously shared the video below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.washington.edu/events/webcast/silverlightplayer/?asx=mms://videosrv6.cs.washington.edu/talks/Colloquia/high/CSimonyi_071129_OnDemand_100_1064K_640x480.wmv"&gt;http://www.cs.washington.edu/events/webcast/silverlightplayer/?asx=mms://videosrv6.cs.washington.edu/talks/Colloquia/high/CSimonyi_071129_OnDemand_100_1064K_640x480.wmv&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Take aways:&lt;br /&gt;1. 3000 mil just got you into the door of the space program. There was so much more behind the scene in order to really make it to the launch pad. Even if I have 3000 mil in my pocket, I probably won't be able to go through the 12-month long training...&lt;br /&gt;&lt;br /&gt;2. Simonyi talked about some of the engineering practices and weird tradtions which were suprisingly simple and even laughable sometimes. Seriously, when it comes to space flight, we were just like our early ancestors trying to play with fire. We pray and hope we don't get burnt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4038426501825000627-828280410595278576?l=reallynouse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://reallynouse.blogspot.com/feeds/828280410595278576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4038426501825000627&amp;postID=828280410595278576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4038426501825000627/posts/default/828280410595278576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4038426501825000627/posts/default/828280410595278576'/><link rel='alternate' type='text/html' href='http://reallynouse.blogspot.com/2008/11/space-flight.html' title='Space flight'/><author><name>Gary</name><uri>http://www.blogger.com/profile/10199801609079544944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_syPXDyqueDc/STd8egiMZZI/AAAAAAAAAAM/tQ2vyyA0kdM/S220/panda2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4038426501825000627.post-9190354135571855754</id><published>2008-11-19T21:20:00.000-08:00</published><updated>2008-11-19T22:08:11.954-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>Cheat sheet to create ASP.NET AJAX control</title><content type='html'>Recently I have done a project that required me to do some ASP.NET AJAX coding. It is relatively straightforward to create a customer AJAX control once I got familiar with the whole pattern. But just when I felt comfortable, I started to forget some of the minor details. So I created a cheat sheet. Here it is:&lt;br /&gt;&lt;br /&gt;* Suppose you have installed AJAX extension and have all the ASP.NET project ready to go in Visual studio:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a the javascript file by&lt;strong&gt; &lt;/strong&gt;registering the namespace, defining a class body, and registering the class. This contains the meat of the AJAX behavior.&lt;br /&gt;For example:&lt;br /&gt;&lt;span style="font-family:courier new;font-size:78%;"&gt;&lt;span style="font-size:100%;"&gt;Type.registerNamespace("my.controls");&lt;br /&gt;my.controls.customcontrol = function(element) {...} my.controls.customcontrol.prototype = {...}&lt;br /&gt;my.controls.customcontrol.registerClass(&lt;br /&gt;"my.controls.customcontrol",&lt;br /&gt;sys.UI.Control&lt;br /&gt;);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Change the "Build action" of the javascript as "Embedded as resource" so that the script is embedded into the assembly.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add an assembly level attribute in the project to expose the javascript as Web resource, so that ASP.NET can locate it in the assembly.&lt;br /&gt;For example:&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;[assembly : WebResource("AssemblyName.control.js", "text/javascript")]&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Create a matching C# class that inherits from ScriptControl base class.&lt;br /&gt;You need to the following two methods:&lt;br /&gt;&lt;em&gt;&lt;br /&gt;GetScriptDescriptors():&lt;/em&gt; This method returns data describing the mapping of C# property value to the corresponding javascript properties.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;GetScriptReferences(): &lt;/em&gt;This method returns all the javascript that needs to be delivered to the client side when "rendering" this AJAX control. The javascript file created earlier should be included as a reference.&lt;br /&gt;&lt;br /&gt;This step integrates the delivery of the AJAX javascript into the existing ASP.NET page life cycle. When the ASP.NET renders this control in an .aspx page, the ScriptControl class will render out the proper &amp;lt;script&amp;gt; element based on what these two methods return (instead of outputing HTML)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;As you can see, there are a few steps to glue the javascript into the ASP.NET pipeline. Now you can use the AJAX control the same way as the normal ASP.NET controls. But finally, you must have &amp;lt;ScriptManager&amp;gt; &lt;scriptmanager&gt;element on the page in order for the AJAX control to work. :)&lt;/p&gt;&lt;span style="font-size:0;"&gt;&lt;p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4038426501825000627-9190354135571855754?l=reallynouse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://reallynouse.blogspot.com/feeds/9190354135571855754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4038426501825000627&amp;postID=9190354135571855754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4038426501825000627/posts/default/9190354135571855754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4038426501825000627/posts/default/9190354135571855754'/><link rel='alternate' type='text/html' href='http://reallynouse.blogspot.com/2008/11/cheat-sheet-to-create-aspnet-ajax.html' title='Cheat sheet to create ASP.NET AJAX control'/><author><name>Gary</name><uri>http://www.blogger.com/profile/10199801609079544944</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_syPXDyqueDc/STd8egiMZZI/AAAAAAAAAAM/tQ2vyyA0kdM/S220/panda2.jpg'/></author><thr:total>0</thr:total></entry></feed>
