October 2005 - Posts

BlogWorth
Sunday, October 30, 2005 2:37 PM

Not much posts from me lately, been busy finishing a chapter to an upcoming book on AJAX that I am working on with Wally McClure and Scott Cate.

I couldn't help but check this our though. It seems lots of people are doing it (Mitch and Matty), and I was curious to see what my blog value is. Check out this link (http://www.business-opportunities.biz/projects/how-much-is-your-blog-worth/) where you can submit the blog URL and it calculates the monetary value of your blog.

Mine came in at a staggering $3,951.78. Ok, so its not staggering, but its better than $0. Now if only I could that money sent out to me.....


My blog is worth $3,951.78.
How much is your blog worth?

ASP.NET Podcast - #24 I think? Atlas here there and everywhere, Wally on books...
Saturday, October 22, 2005 12:26 PM

Well thats what I get for being slack, Wally has slipped in another podcast just after I posted up about the last one.

 

What big scoop can I bring you thats a little different though, well about all I can offer is that it is in fact podcast #24, not #23. Yes, earth shattering I know. Take a moment to absorb it before moving on.... so without further ado, the podcast....

 

Subscribe, its the good thing to do. iTunes and iPodder links.

 

Download.

 

Special thanks go out to Wilco Bauwer who has posted a lot of his insight into Atlas in the ASP.NET forums.

 

Show Notes:

  • Emails.
    • Our hero Phil Winstanley supports the show
      And thanks go out to Plip for these pictures:
      Super Wally
    • Scott Fletcher says that “Wally is the hottest thing in Podcasting!”
    • Chris Frazier agrees with Scott.
  • Atlas.
    • What are some of the Atlas pieces-n-parts.  Wally bloggerizes from Nikhil Kothari’s weblog. (Note: Wally made up the word bloggerize.  It means to steal from someone else's blog without their permission.  You learn something new on a podcast every day.........).
    • Example (Note: There is an sState, which refers to an HTML tag, and there is a property referred to as State.  These are separate and I appologize for any confusion):

Client Side Code:
        function LoadTest(){

            Samples.AspNet.WebServiceTest.ReturnDataSet(ReturnDataTableCallBack);

        }

       

        function ReturnDataTableCallBack(result)

        {

            var i = 0;

            var ddl = document.getElementById("sState");

            var optionItem;

            iLength = document.getElementById("sState").options.length;

            document.getElementById("sState").visible = true;

            //document.getElementById("txtAreaResult").value = result.get_data();

            for(i=0; i<iLength; i++)

            {

                document.getElementById("sState").options[0] = null;

            }

            alert("Length: " + result.get_length() );

            for(i=0; i<result.get_length(); i++)

            {

                var optAdd = new Option(result.getItem(i).getProperty("State"),result.getItem(i).getProperty("tblStateId"));

                for(m in result.getItem(i)){

                    //alert(m);

                }

                document.getElementById("sState").options.add(optAdd);

            }

            debug.dump(result, "DataTable Result", true);

        }
Server Side Code:
        [WebMethod]

        public System.Data.DataTable ReturnDataSet()

        {

            DataTable dt = new DataTable();

            DataRow dr;

            dt.Columns.Add(new DataColumn("tblStateId", System.Type.GetType("System.Int32")));

            dt.Columns.Add(new DataColumn("State", System.Type.GetType("System.String")));

            dr = dt.NewRow();

            dr["tblStateId"] = 1;

            dr["State"] = "Tennessee";

            dt.Rows.Add(dr);

            dr = dt.NewRow();

            dr["tblStateId"] = 2;

            dr["State"] = "Alabama";

            dt.Rows.Add(dr);

            return (dt);

        }

  • Debugging with Atlas.
    • debug.dump(object, name [, recursive[, indention padding]]);The output from debug.dump.>
    • for(m in results) alert(m);
  • Wally does pimp himself.
  • Book Status.
    • ADO.NET.
    • Ajax/Atlas Book.
    • Please come be the IIS7 lead author.  Being a lead author is so much fun.
by Glav | with no comments
ASP.NET Podcast #23 - Spang, Atlas and life....
Friday, October 21, 2005 12:32 PM

How remiss of me. Wally has posted up about the latest podcast and I haven't done the same. You know how it works by now, Wally posts it, then I shortly follow (just in case you missed Wally's post). Well here it is.

Download.

Subscribe  - It makes life easier.  Get a copy of iPodder or iTunes.

Show Notes:

  • Spang.
    • What Spang Truly is.
    • Dave Sussman's Reaction to the Spang announcement.
    • The Joke takes root and grows exponentially.
  • The Channel9 Reaction.
  • Atlas code.
    • Server side Web Code:
      [WebMethod]
      public string HelloWorld(string strInput)
      {
      return "Hello " + strInput + " Server Time: " + DateTime.Now.ToString() ;
      }
    • Client Side Javascript:
      <script type="text/xml-script">
      function
      OnClickTest() {
      var txtInputBox = document.getElementById("txtInput");
      Samples.AspNet.WebServiceTest.HelloWorld(txtInputBox.value, HelloWorldCallBack);
      }
      function HelloWorldCallBack(result){
      alert("Returned Value: " + result);
      }
      </script>

 

Atlas Declarative markup
Friday, October 14, 2005 6:12 PM

Atlas has 3 main ways of specifying functionality and behaviours. Imperative (via std javascript which most people would be familiar with, particularly those with AJAX.NET experience), declaratively, and through server controls. Previous posts have dealt mostly with the imperative method, however this post will transition somewhat into the delcarative.

Take a look at the code fragment below which simply has a button, which will invoke a 'GetCustomer' web service asynchronously, and display the results:

<script type="text/xml-script">
        <page xmlns:script="
http://schemas.microsoft.com/xml-script/2005">
            <references>
                <!-- Repath the following src attributes, using regular client relative paths as necessary -->
                <add src="ScriptLibrary/AtlasUI.js" />
                <add src="ScriptLibrary/AtlasControls.js" />
            </references>
            <components>
                <serviceMethod id="custService"
                      url="MyService.asmx" methodName="GetCustomer">
                        <completed>
                            <invokeMethod target="serviceBinding" method="evaluateIn" />
                        </completed>
                </serviceMethod>
               
                <textBox id="txtResults">
                 <bindings>
                    <binding id="serviceBinding" property="text"
                      dataContext="custService"
                      dataPath="response.object"
                      automatic="false" />
                 </bindings>
                </textBox>
                    
                <button id="btnGet">
                    <click>
                        <invokeMethod target="custService" method="invoke" />
                    </click>
                </button>
               
            </components>
        </page>
    </script>

This represents an Atlas declarative markup section. Atlas interprets this markup, and emits the necessary code to 'hookup' the relevent onclick event of the 'btnGet' button, call the webservice (specifically the 'GetCustomer' webmethod) defined in the <serviceMethod> and display those results in the <textbox>. The HTML code would simply look like:

<input id="btnGet" type="button" value="Get a Customer" /><br />
<label id="lbl1">Results:</label><br />
<input id="txtResults" type="text" /><br />

Notice that the 'txtResults' input box is linked to the <textbox> Atlas declarative markup via its ID attribute, and similarly with the 'btnGet' input button and associated Atlas markup.

Currently, all this must be handcoded, however designer support around this declarative model is forthcoming. You will also notice that to achieve the same functionality imperatively (using simple javascript) actually takes a lot less code. While this is true for simple scenarios, the more complex it gets, and the more difficult it will be to write imperatively. This is where the declarative model will be very useful. Obviously, usage of Atlas server controls is another option, but for now, lets stick with the imperative and declarative.

The declarative model has a plethora of options and things to play with, which I will attempt to address in future posts and at this early stage of Atlas, also comes with a few issues, one of which I may detail in my next post. Stay tuned....

ASP.NET Podcast Show #22 - Atlas with Shanku Niyogi and Nikhil Kothari
Saturday, October 8, 2005 8:49 PM

Well this podcast was one of the highlights of my visit to the United States as part of the ASPInsiders summit. Most of the communications between Shanku, Nikhil and Wally as well, is all virtual so its great to be able to interview Shanku and Nikhil personally, along with "Sir Wally" himself.

Subscribe

Download

Show Notes:

Update: As of Friday Afternoon (10/7) at 12 noon EDT, we are having some problems with our hosting environment. If you have problems accessing the podcast, please bear with us while we try and get this issue sorted out.

by Glav | with no comments
Atlas Page Methods
Friday, October 7, 2005 9:05 PM

Want to access a method within your page asynchronously using the Atlas framework? Its easy.

Mark your method with the '[WebMethod]' attribute like so:

// Server side code within your .ASPX file or .ASPX.CS code beside file.
[WebMethod]
public string SomeMethod()
{
   return DateTime.Now.ToLongTimeString();

}

In your .ASPX file, you need to include the Atlas javascript file:

<atlas:Script ID="Script1" runat="server" Path="~/ScriptLibrary/Atlas.js" />

The method proxy will be generated by the Atlas framework within the 'PageMethods' namespace and so you can call it like so:
(Note: The 'callback' function is specified as part of the method argument list. In this case its the OnRequestComplete function).

<script type="text/javascript">
  // Calls the 'SomeMethod' server side code asynchronously.

  function
CallThePageMethod() {
    PageMethods.SomeMethod(OnRequestComplete);
  }

  // This function is the callback function that gets executed when the server side code is complete
  // and passes in the result of the server side code as the 'arg' argument.

  function
OnRequestComplete(arg) {
    alert("Result of callback was: " + arg);
  }

</script>

Additionally, if you wanted specify arguments in your server side code, and have the client side asynchronous call specify those arguments, and also define a function to be called if an error occurs, you can simply specify those arguments within the initial call like so:

<script type="text/javascript">
  // Calls the 'SomeMethod' server side code asynchronously.

  function
CallThePageMethod() {
    PageMethods.SomeMethod("myArgument1", "myArgument2", OnRequestComplete, OnRequestError);
  }
</script>

In this and a previous post, I have dealt mostly with the raw scripting part of the Atlas framework. Atlas is much much more than that, and in future posts, I will discuss the aspects the various other components of the Atlas framework. Namely, the declarative scripting, and the server side controls.

ASP.NET Podcast - Show #21. Knights of the roundtable.
Wednesday, October 5, 2005 6:07 AM

The ASP.NET Podcast show #21 is on the street. A bunch of ASPInsiders in a roundtable discussion (we'll actually sitting in a somewhat circular group in Wallys room) about some of the new .Net features.

Download.

Subscribe.

Show Notes:

  • A generic roundtable discussion regarding .NET tools coming down the line from Microsoft.
  • Linq.
  • Quartz.
  • Atlas.
  • Other items
  • Aaron Seet came 6,000 miles just to be on the ASP.NET Podcast.  The things that people have done for the podcast just amaze me.

Note: Phil Winstanley made some videos during the roundtable.  We are going to distribute them through the XML feed.

by Glav | with no comments
Atlas, scripting functionality and delegates
Tuesday, October 4, 2005 6:17 PM

Atlas promises a lot of things, and one of the things I wanted to mention was the way it brings a familiar .Net development paradigm to the javascript world. Atlas makes the javascript look very much like its .Net server side counterpart in terms of development framework. What does that mean? Well lets take an example.

Delegates are a typical .Net framework feature, and Atlas has made them available and useable on javascript. In fact, they are an integral part of the Atlas client script framework. To create a delegate using the Atlas framework, simply use the:

_myDelegate = Function.prototype.createDelegeate(this,this._myFunction);

function _myFunction(sender, eventArgs)
{
   ....
}

This delegate can then be used for specifying callback functions to other system events that require callbacks. Again, another example using the Atlas provided timer object:

_timer = new Web.Timer(); 
_tickHandler = Function.CreateDelegate(this,this._onTimerTick);
_timer.set_Interval(500);
_timer.tick.add(_tickHandler);
_timer.set_enabled(true);


Here we are creating a new timer object. Then creating a new delegate which is assigned to the 'tick' event and will be invoked every 500 milliseconds. Finally we enable the timer so that it begins to fire events at the designated intervals.

Atlas provides a large abstraction over current scripting methods and attempts to provide the familiar server side development model on the client. Part of this is the base class framework implementation that Atlas offers. Note: This does not mean it is the goal of Atlas to get everyone coding in javascript again, but it does provide a powerful and rich framework from which to build upon. I shall be posting more details on this as time progresses so keep an eye out.

 

by Glav | with no comments
MVP Summit complete, G. Andrew Duthie Singing
Sunday, October 2, 2005 6:03 PM

Well the MVP Summit is now officially over. The event proved very productive for me and I got to meet up with many other MVP's and Microsoft staff that I had previously not met, in addition to those whom I had previously at the MVP summit last year. The MVP party was pretty cool and was held at the Sci-Fi museum near the Space Needle. Quite a cool place with lots to look at like the guitar museum, Sci-Fi museum, and they even provided a special Karaoke section.

The Karaoke section got pretty wild later on in the night and made my ears hurt. Luckily though, before it got too packed, I managed to capture G.Andrew Duthie  ( a developer evangelist ) doing his "thang" on the Karaoke stage with his rendition of Brown Eyed Girl.

Note: Apologies for the bad quality, my phone is not that good at photo or video.

Check out the actual video here. (8Mb)

Now its onto the ASPInsiders summit. More fantastic technical content is yet to come.

More Posts

This Blog

Syndication