<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fremus.co.za &#187; AJAX</title>
	<atom:link href="http://www.fremus.co.za/blog/category/web-technologies/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fremus.co.za/blog</link>
	<description>Demistifying Life and Web Development</description>
	<lastBuildDate>Sun, 27 Nov 2011 15:56:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WCF, ASP.NET Webforms, ASP.NET MVC and jQuery</title>
		<link>http://www.fremus.co.za/blog/2010/11/wcf-asp-net-webforms-asp-net-mvc-and-jquery/</link>
		<comments>http://www.fremus.co.za/blog/2010/11/wcf-asp-net-webforms-asp-net-mvc-and-jquery/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 08:04:47 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=710</guid>
		<description><![CDATA[I haven&#8217;t written a technical article in a while but I thought I would write one that discusses AJAX calls with jQuery. Before I get into it I would like to reiterate some of my personal development objectives of late: Don&#8217;t do ANY UI manipulation in any of my server side API&#8217;s. The sole purpose [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t written a technical article in a while but I thought I would write one that discusses AJAX calls with jQuery. Before I get into it I would like to reiterate some of my personal development objectives of late:</p>
<ol>
<li>
              Don&#8217;t do ANY UI manipulation in any of my server side API&#8217;s. The sole purpose of any API within the applications I build is to deal with business layer logic and the data related to it. Ideally speaking I would want my API to return structured data which is easily transformed into a format for the client application using the API (e.g. JSON). I have had experiences within another development team in the recent past where the API returned HTML with the data and to say that this is a mess is understating the obvious &#8211; if you think about it quickly then you can understand the impact of one style or layout change will have on this approach. It also blurs your application in terms of its concerns and makes testing a problem. So ideally I dont want any UI logic in any of my API&#8217;s.
        </li>
<li>
The second objective I have is that all my UI for web applications must be handled with client-side scripts. Client side includes both static HTML, CSS and JavaScript, and in this instance I specifically refer to JavaScript and the handling of my API&#8217;s data using JSON, for which I use jQuery. The REST (:D) of this article is dedicated to the AJAX options available in an ASP.NET application.
</li>
</ol>
<p><strong>Dealing with AJAX in an ASP.NET Application</strong></p>
<p>Developing ASP.NET applications gives you two &#8220;frameworks&#8221; or &#8220;architectures&#8221; to work with:</p>
<ol>
<li>ASP.NET Webforms</li>
<li>ASP.NET MVC</li>
</ol>
<p>Notice that each architecture or framework uses the ASP.NET runtime which in turn runs on the .NET framework, and part of the .NET framework is the Common Language Runtime (CLR). People often think ASP.NET automatically refers to webforms. The difference between the architectures lies both in how it was designed and who it was designed for. Webforms was designed for Windows Forms developers working within the Visual Studio drag-and-drop environment and aimed to provide an abstraction of Windows Forms for the web. With webforms you could simply drag and drop controls onto a design surface and assign properties to the controls. The problem with webforms was that it required state management and to deal with the state management viewstate was created. Basically state management refers to a controls ability to retain its &#8220;value state&#8221; across postbacks. So if I created a simple label and set its text to &#8220;hello world&#8221; viewstate is used to retain that text value throughout the life of the rendered page. Webforms also introduced the concept of the Page Life Cycle, which exposed certain events at certain points of the page&#8217;s rendering process. The problem with viewstate is that the viewstate is inserted into your HTML pages which causes the page to bloat &#8211; so there is no clean markup. Viewstate totally goes against the grain of how the web works &#8211; being stateless.</p>
<p>ASP.NET MVC addresses some of the issues associated with webforms by using a mature and well known architectural pattern &#8211; Model-View-Controller, as used in Ruby-On-Rails. ASP.NET MVC does not use the page lifecycle for a start and it embraces the web&#8217;s statelessness instead of fighting it. The result is that you have no ViewState and this means that there is no HTML bloat and you also have complete control over your HTML.</p>
<p>There are a couple of ways to consume AJAX requests in ASP.NET but they fall into two categories:</p>
<ol>
<li>SOAP</li>
<li>REST</li>
</ol>
<p>In my previous development role I worked with guys that used SOAP to do AJAX requests and although this approach was good enough it was specifically aimed at ASMX web services which meant adding web references to your project. Needless to say adding these reference is a pain in the ass, because if a new method was added to a service you had to first update your reference before you could see the method. REST, however, addresses this issue by allowing you to make calls to URL&#8217;s, and not by adding any references. It also means that if a new method is created its available immediately. The remainder of this article is about consuming REST-like services in an ASP.NET application.</p>
<p>With my latest development effort I started out by using Page Methods in an ASP.NET Webform application. Why ASP.NET webforms you may ask? Well I wanted to focus on the business value and I just started out with Webforms without concerning myself too much with the technical side of things. Page methods implement a REST-like architecture and simply requires that you add a WebMethod attribute in your code-behind&#8217;s CS file like this:</p>
<pre name="code" class="csharp">
    [WebMethod]
    public static Dictionary<DateTime, List<MonthReport>> GetLastSixMonthReport()
</pre>
<p>You could then access the web method through jQuery like this (notice the Default.aspx/GetImportsLastSixMonths):</p>
<pre name="code" class="javascript">
    $.ajax({
        type: "POST",
        url: "Default.aspx/GetImportsLastSixMonths",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            var dict = msg.d;
            var html = '';
            $("#importsData").empty();
            html += dict;
            $("#importsData").append(html);
        }
    });
</pre>
<p>The main issue I have with this approach was that if I wanted to create a new web project I had to re-create the web methods &#8211; which is not ideal. So if I wanted to move this project over to a new MVC app I would have to recreate the methods. Based on this I decided to create a separate WCF project that could host all my methods and deliver them in a REST-JSON way. To get WCF to deliver JSON in a REST fashion you need to do two important things:</p>
<ul>
<li>Configure it</li>
<li>Add the appropriate Interface attributes</li>
</ul>
<p>Configuring a WCF service for JSON requires that you add an endpoint address to the service itself like this:</p>
<pre name="code" class="xml">
<endpoint address="ajaxEndpoint" behaviorConfiguration="AjaxBehaviour" binding="webHttpBinding" name="RESTEndpoint" contract="IMyInterface"/>
</pre>
<p>You also need to add an endPointBehavior like this:</p>
<pre name="code" class="xml".
			<endpointBehaviors>
				<behavior name="AjaxBehaviour">
					<webHttp/>
				</behavior>
			</endpointBehaviors>
</pre>
<p>In your service behaviours you need to set httpGetEnabled to true as well. I added this in my service class:</p>
<pre name="code" class="csharp">
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
</pre>
<p>In service contract I added the WebInvoke attribute to each method, like this:</p>
<pre name="code" class="csharp">
    [OperationContract]
    [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
    ProductCollectionView[] GetProductCollectionViews();
</pre>
<p>Once I set this up I could access the JSON-enabled endpoint: http://localhost/LRB2CServiceLayer_v1/LRB2c.svc/ajaxEndpoint/GetProductCollectionViews and I would see the JSON. Notice that the JSON comes with a MethodNameResult as opposed to the &#8220;d&#8221; from the page methods. Consuming it uses a similar approach to the jQuery for page methods, except that you use a GET (which is a little dodgy):</p>
<pre name="code" class="javascript">
    $.ajax({
        type: "GET",
        url: "http://localhost/LRB2CServiceLayer_v1/LRB2c.svc/ajaxEndpoint/GetProductCollectionViews",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            var dict = msg["GetProductCollectionViewsResult"];
            var html = '';
            $("#importsData").empty();
            html += dict;
            $("#importsData").append(html);
        }
    });
</pre>
<p>I decided to convert the WCF service to a class library (DLL) instead because I had all kinds of issues with XSS because I ran the WCF service as a separate web application. The idea was that a WCF service was easily shared between web apps. I basically combined the class library with a MVC web app instead. A class library can just as easily be shared among multiple projects or web sites. The JSON that MVC returns is different to WCF and Webforms &#8211; it just returns the object, no indexer/key such as &#8220;d&#8221;. Getting MVC to return JSON is pretty straight forward:</p>
<pre name="code" class="csharp">
        [HttpPost]
        public JsonResult GetGetProductCollectionViews()
        {
        }
</pre>
<p>Of the three methods/technologies I described I like the ASP.NET MVC approach because:</p>
<ul>
<li>Its RESTful</li>
<li>The JSON result only contains the object(s)</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2010/11/wcf-asp-net-webforms-asp-net-mvc-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax in the .NET environment&#8230;</title>
		<link>http://www.fremus.co.za/blog/2010/08/ajax-in-the-net-environment/</link>
		<comments>http://www.fremus.co.za/blog/2010/08/ajax-in-the-net-environment/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 19:29:25 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/2010/08/ajax-in-the-net-environment/</guid>
		<description><![CDATA[Ajax is not new, its not revolutionary, but it has changed the way I view web development. Javascript no longer comes as a might-have, instead it comes as a critical part of any website application. These days I use JavaScript as the UI scripting tool of choice, and I try to steer away from doing [...]]]></description>
			<content:encoded><![CDATA[<p>Ajax is not new, its not revolutionary, but it has changed the way I view web development. Javascript no longer comes as a might-have, instead it comes as a critical part of any website application. These days I use JavaScript as the UI scripting tool of choice, and I try to steer away from doing to much UI lifting in my server side code. jQuery makes dealing with UI quite pleasant. </p>
<p>I have also, in the last year and a half or so, been coding without MS Ajax. I have let go of things like the UpdatePanel and the Script Manager and have instead come to do direct Ajax calls to .ashx, default.aspx and web services. It feels that when you follow this approach that you have much tighter control over the quality of the UI. So what are your options for making Ajax calls in a .NET environment? I would like to think that there are a few options that stand out:</p>
<ul>
<li>Direct page ajax calls – you can use jQuery’s ajax function to call .ashx and .aspx pages. I have recently started using the [WebMethod] attribute in my .aspx files to make calls, and what I like about it is that you can tell the page to output JSON, which automatically serializes the method’s return type. I have also used ashx files to do ajax calls and this worked well</li>
<li>SOAP-based web services – an approach I learned last year was to use a javascript soap parser to parse soap-based web services. These were mainly .asmx services. You can configure .asmx services to return JSON as well</li>
<li>WCF-services can be configured for SOAP or JSON but also use a REST-like approach</li>
</ul>
<p>What other options are there for .NET developers when making Ajax calls?</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2010/08/ajax-in-the-net-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting POST values with an ASHX file</title>
		<link>http://www.fremus.co.za/blog/2009/11/getting-post-values-with-an-ashx-file/</link>
		<comments>http://www.fremus.co.za/blog/2009/11/getting-post-values-with-an-ashx-file/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 12:56:32 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technologies]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=536</guid>
		<description><![CDATA[Today I had this scenario where I wanted to post items from multiple HTML input elements to a generic handler (.ashx) file without using the action attribute of the form. Specifying the action meant that that you are navigated away from the page where the action is happening, which means re-creating UI logic. How did [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had this scenario where I wanted to post items from multiple HTML input elements to a generic handler (.ashx) file without using the action attribute of the form. Specifying the action meant that that you are navigated away from the page where the action is happening, which means re-creating UI logic. How did I achieve this? By using an XMLHttpRequest and using a POST method. GET places everything inside a querystring, which is ok, but I just wondered what would happen if the content was too long for the querystring. I guess the same can be said for POST, but it just seems POST uses a different way to transfer the data. So lets say you had this JavaScript:</p>
<pre name="code" class="javascript">
    getXMLHTTPPostObject: function(url, elementName, parameters) {
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        }
        else if (window.ActiveXObject) {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else {
            alert("Your browser does not support XMLHTTP!");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                document.getElementById(elementName).innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.open("POST", url, true);
        xmlhttp.send(parameters);
    }
</pre>
<p>I use this function to create an XMLHttpRequest object by passing it:</p>
<ul>
<li>the URL for the AJAX call</li>
<li>an elementName to put the result of request in</li>
<li>A parameter list</li>
</ul>
<p>I then have a function like this:</p>
<pre name="code" class="javascript">
    addPost: function() {
        objXMLHTTP.getXMLHTTPPostObject("url to handler", "categoryTemp", "postTitle=" + document.getElementById("txtPostTitle").value + "&#038;blogpost=" + document.getElementById("txtBlogPost").value);
    }
</pre>
<p>The function gets the values of two HTML input elements and passes it as parameters. The parameters are then used in the POST HTTPMethod. My next challenge was to get the data in the generic handler (.ashx) so that I can process it. I also wanted to return the data from the ASHX file to see that its processed successfully. So in my handler I created this code:</p>
<pre name="code" class="csharp">
        context.Response.ContentType = "text/plain";
        System.IO.Stream body = context.Request.InputStream;
        System.Text.Encoding encoding = context.Request.ContentEncoding;
        System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
        //if (context.Request.ContentType != null)
        //{
        //    context.Response.Write("Client data content type " + context.Request.ContentType);
        //}
        string s = reader.ReadToEnd();
        string[] content = s.Split('&#038;');
        for (int i = 0; i < content.Length; i++)
        {
            string[] fields = content[i].Split('=');
            context.Response.Write("
<div><strong>" + fields[0] + "</strong></div>

");
            context.Response.Write("
<div>" + fields[1] + "</div>

");
        }
        //context.Response.Write(s);
        body.Close();
        reader.Close();
</pre>
<p>I first create a class of type Stream that is instantiated through the Response.InputStream property, after which I set the content encoding for the response object. I then create a StreamReader instance and call its ReadToEnd method. After this I do some string manipulation and return the text back to the XMLHttpRequest object, which then writes the content to an HTML Element.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2009/11/getting-post-values-with-an-ashx-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScript alphabetical sorting (A is less than a)</title>
		<link>http://www.fremus.co.za/blog/2009/10/javascript-alphabetical-sorting-a-a/</link>
		<comments>http://www.fremus.co.za/blog/2009/10/javascript-alphabetical-sorting-a-a/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 14:24:53 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=532</guid>
		<description><![CDATA[So A < a, which means if you use the sort() function and your array contains elements starting with upper and lowercase then the uppercase will appear first, i.e.: Art, ASP.NET, LawDeed, LINQ will appear as: ASP.NET Art LawDeed LINQ To get this working correctly you need the following function: charOrdA: function(a, b) { a [...]]]></description>
			<content:encoded><![CDATA[<p>So A < a, which means if you use the sort() function and your array contains elements starting with upper and lowercase then the uppercase will appear first, i.e.:</p>
<p>Art, ASP.NET, LawDeed, LINQ will appear as:<br />
ASP.NET<br />
Art<br />
LawDeed<br />
LINQ</p>
<p>To get this working correctly you need the following function:</p>
<pre name="code" class="javascript">
    charOrdA: function(a, b) {
        a = a.toLowerCase(); b = b.toLowerCase();
        if (a > b) return 1;
        if (a < b) return -1;
        return 0;
    }
</pre>
<p>This function will make sure your alphabetical sortorder is correct so that the list appears like this:<br />
Art<br />
ASP.NET<br />
LawDeed<br />
LINQ</p>
<p>You have to pass the function name to the sort function like this:</p>
<pre name="code" class="javascript">

arrCategories.sort(charOrdA);
</pre>
<p>Note that there are no parenthesis.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2009/10/javascript-alphabetical-sorting-a-a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting to understand JavaScripts prototypal nature</title>
		<link>http://www.fremus.co.za/blog/2009/10/getting-to-understand-javascripts-prototypal-nature/</link>
		<comments>http://www.fremus.co.za/blog/2009/10/getting-to-understand-javascripts-prototypal-nature/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 08:15:43 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Web Technologies]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=498</guid>
		<description><![CDATA[One of the things that are quite weird to get use to, from a C# developer&#8217;s perspective, is JavaScript&#8217;s prototypical nature. Check out this basic example: var objXMLHTTP = { getXMLHTTPObject: function(url,elementName) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { // code [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that are quite weird to get use to, from a C# developer&#8217;s perspective, is JavaScript&#8217;s prototypical nature. Check out this basic example:</p>
<pre name="code" class="javascript">

var objXMLHTTP =
{
    getXMLHTTPObject: function(url,elementName) {
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        }
        else if (window.ActiveXObject) {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else {
            alert("Your browser does not support XMLHTTP!");
        }
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                document.getElementById(elementName).innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.open("GET", url, true);
        xmlhttp.send(null);
    }
};
objXMLHTTP.getXMLHTTPObject("http://localhost/YieldTester/Handler.ashx", "testDiv");
</pre>
<p>The code above creates a simple XMLHTTPRequest object, but you do not create an instance of the object, you call it directly. Note objXMLHTTP.getXMLHTTPObject. In C# you might have created an object and then you instantiate it through an instance of that object. I have taken the code as is given on <a href="http://www.w3schools.com/ajax/ajax_server.asp" onclick="urchinTracker('/outgoing/www.w3schools.com/ajax/ajax_server.asp?referer=');">W3Schools</a> and modified it a little. </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2009/10/getting-to-understand-javascripts-prototypal-nature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding JavaScript from a C# developer&#8217;s perspective</title>
		<link>http://www.fremus.co.za/blog/2009/01/understanding-javascript-from-a-c-developers-perspective/</link>
		<comments>http://www.fremus.co.za/blog/2009/01/understanding-javascript-from-a-c-developers-perspective/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 09:01:00 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=349</guid>
		<description><![CDATA[So during the week I did a lot of JavaScript and the thing that I found most, what shall I say, mindshiftable, is that you cannot think in the classical OOP way with JavaScript, as you do with C#. JavaScript does everything in functions, and everything within JavaScript is prototypical. Inheritance is prototypical, everything is [...]]]></description>
			<content:encoded><![CDATA[<p>So during the week I did a lot of JavaScript and the thing that I found most, what shall I say, <em>mindshiftable</em>, is that you cannot think in the classical OOP way with JavaScript, as you do with C#. JavaScript does everything in functions, and everything within JavaScript is prototypical. Inheritance is prototypical, everything is prototypical. You dont create instances of objects but rather use the objects themselves. So its kinda like a static class, where you invoke members directly. </p>
<p>I started this week by looking at a SOAP client written in JavaScript that makes calls to web services. What the SOAP client basically does is cache the WSDL with all the functions in it, from a web service (in this case an asmx file), and then it sends SOAP requests, processes the request and if there is a callback it does the callback function. The code for the SOAP client is based on <a href="http://www.codeproject.com/KB/ajax/JavaScriptSOAPClient.aspx" onclick="urchinTracker('/outgoing/www.codeproject.com/KB/ajax/JavaScriptSOAPClient.aspx?referer=');">this code</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2009/01/understanding-javascript-from-a-c-developers-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unobtrusive JavaScript and a Session-less shopping cart</title>
		<link>http://www.fremus.co.za/blog/2008/11/unobtrusive-javascript-and-a-session-less-shopping-cart/</link>
		<comments>http://www.fremus.co.za/blog/2008/11/unobtrusive-javascript-and-a-session-less-shopping-cart/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 19:05:44 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=254</guid>
		<description><![CDATA[What is the idea behind unobtrusive JavaScript? What makes JavaScript unobtrusive? Does it mean removing any onlclick events in your markup and handling those click events with an approach as provided with jQuery? With jQuery its very (extremely) easy to traverse between DOM elements and its even easier associating events to elements and executing them. [...]]]></description>
			<content:encoded><![CDATA[<p>What is the idea behind unobtrusive JavaScript? What makes JavaScript unobtrusive? Does it mean removing any onlclick events in your markup and handling those click events with an approach as provided with jQuery? With jQuery its very (extremely) easy to traverse between DOM elements and its even easier associating events to elements and executing them.</p>
<p>I havent been doing a lot of JavaScript recently but you cannot really avoid it, but you can also not build an entire website with JavaScript and HTTPRequests alone (not search engine friendly), but you can also not rely entirely on server side code to do all the magic for you.</p>
<p>The other issue that has been bugging me of late is the idea of creating a session-less shopping basket, a shopping basket that uses a combination of web services and traditional classes. Within the .NET environment the only reason you might need to use sessions is to store DataTables or DataSets, but the question is how expensive is that on server resources. Would I be able to create the same session-based application with web services and traditional classes? After all you are adding web references to your web applications, and those web references all contain class declarations. </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2008/11/unobtrusive-javascript-and-a-session-less-shopping-cart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demystifying some .NET Issues</title>
		<link>http://www.fremus.co.za/blog/2008/10/demystifying-some-net-issues/</link>
		<comments>http://www.fremus.co.za/blog/2008/10/demystifying-some-net-issues/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 18:46:21 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=189</guid>
		<description><![CDATA[What seemed a little odd to me today was that SQL Server Express 2005 is download-able from two places. Both shows different file sizes. Another issues that needs clarity is ASP.NET and .NET framework versions. .NET 3.5 is an &#8216;extension&#8217; of .NET 2.0 and replaces .NET 3.0. .NET 3.5 covers AJAX (Asynchronous JavaScript and XML) [...]]]></description>
			<content:encoded><![CDATA[<p>What seemed a little odd to me today was that SQL Server Express 2005 is download-able from <a href="http://www.microsoft.com/express/2005/sql/download/default.aspx" onclick="urchinTracker('/outgoing/www.microsoft.com/express/2005/sql/download/default.aspx?referer=');">two</a> <a href="http://www.microsoft.com/downloads/details.aspx?familyid=220549b5-0b07-4448-8848-dcc397514b41&#038;displaylang=en" onclick="urchinTracker('/outgoing/www.microsoft.com/downloads/details.aspx?familyid=220549b5-0b07-4448-8848-dcc397514b41_038_displaylang=en&amp;referer=');">places</a>. Both shows different file sizes. </p>
<p>Another issues that needs clarity is ASP.NET and .NET framework versions. .NET 3.5 is an &#8216;extension&#8217; of .NET 2.0 and replaces .NET 3.0. .NET 3.5 covers AJAX (Asynchronous JavaScript and XML) and LINQ (Language Integrated Query)</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2008/10/demystifying-some-net-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery and Microsoft</title>
		<link>http://www.fremus.co.za/blog/2008/09/jquery-and-microsoft/</link>
		<comments>http://www.fremus.co.za/blog/2008/09/jquery-and-microsoft/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 06:41:54 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=180</guid>
		<description><![CDATA[I susbscribe to The Code Project&#8217;s newsletter and today I got some great news, jQuery will be supported in Visual Studio 2008. Now this is some awesome news. Makes one wonder if the Microsoft AJAX library will become redundant. You can read the full article on Scott Gu&#8217;s website.]]></description>
			<content:encoded><![CDATA[<p>I susbscribe to <a href="http://www.codeproject.com/" onclick="urchinTracker('/outgoing/www.codeproject.com/?referer=');">The Code Project&#8217;s newsletter</a> and today I got some great news, jQuery will be supported in Visual Studio 2008. Now this is some awesome news. Makes one wonder if the Microsoft AJAX library will become redundant.</p>
<p>You can read the full article on <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx" onclick="urchinTracker('/outgoing/weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx?referer=');">Scott Gu&#8217;s website</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2008/09/jquery-and-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Light up the Web &#8211; Mix Essentials 2008 Review</title>
		<link>http://www.fremus.co.za/blog/2008/06/light-up-the-web-mix-essentials-2008-review/</link>
		<comments>http://www.fremus.co.za/blog/2008/06/light-up-the-web-mix-essentials-2008-review/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 17:02:50 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[Expression Design]]></category>
		<category><![CDATA[Expression Studio]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=29</guid>
		<description><![CDATA[I attended the Mix Essentials 2008 event at Canal Walk (Cape Town, South Africa) today and there were quite a few things that interested me. There were five speakers at the event: David Ives &#8211; Developer and Platform Strategy Group for Microsoft in South Africa &#8211; Microsoft Brad Abrams &#8211; Group Program Manager for the [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the <strong>Mix Essentials 2008</strong> event at Canal Walk (Cape Town, South Africa) today and there were quite a few things that interested me. There were five speakers at the event:</p>
<ol>
<li>David Ives &#8211; Developer and Platform Strategy Group for Microsoft in South Africa &#8211; <strong>Microsoft</strong></li>
<li>Brad Abrams &#8211; Group Program Manager for the UI Framework and Services Team &#8211; <strong>Microsoft</strong></li>
<li>Michael Koester &#8211; Designer Marketing Manager for Middle East and Africa and Central and Eastern Europe &#8211; <strong>Microsoft</strong></li>
<li>Julian Harris &#8211; <strong>Conchango</strong></li>
<li>David Pugh-Jones &#8211; <strong>Microsoft</strong></li>
</ol>
<p>The event was split into two tracks, a developer track and a designer track, but it generally focussed on <strong>Silverlight</strong>, and more specifically on two software packages, <strong>Visual Studio 2008</strong> and <strong>Expression Studio</strong>, and even more specifically it introduced <strong>XAML</strong> as a common way for these packages to share content between them. <strong>XAML</strong>, <a href="http://en.wikipedia.org/wiki/Extensible_Application_Markup_Language" onclick="urchinTracker('/outgoing/en.wikipedia.org/wiki/Extensible_Application_Markup_Language?referer=');">Extensible Application Markup Language</a> is an <strong>XML-like</strong> language that defines graphic elements in a human readable form that can be used in vector-imaging programs as well as <strong>Visual Studio 2008</strong>. This gives designers the flexibility to design interfaces without having to worry about programmers not being able to replicate their designs in a programming environment. Julian Harris demonstrated that you can export files from <strong>Adobe Illustrator</strong> into <strong>XAML</strong> format and import that <strong>XAML</strong> into <strong>Visual Studio 2008</strong>. <strong>XAML</strong> is also used in the <strong>Expression Studio</strong> range of products which includes amongst other two interesting products:</p>
<ul>
<li>Expression Blend</li>
<li>Expression Design</li>
</ul>
<p><strong>Expression Blend</strong> is, almost like <strong>Adobe&#8217;s Flash Studio</strong>, which is an IDE that allows you to create <strong>WPF (Windows Presentation Foundation)</strong> and Silverlight applications. WPF is a technology that allows developers (and designers) to create applications that give users a better <strong>user experience (UX)</strong>. Contemporary windows applications generally use square (often mundane) windows, whereas <strong>WPF applications</strong> allow designers to implement creative graphics into the interface. Rounded corners and transparent backgrounds for instance are used, and because Expression Blend can read and understand <strong>XAML</strong>, none of a designer&#8217;s creative flair is lost. The developer no longer has any excuses to develop interfaces that do not exactly meet the designer&#8217;s design. </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2008/06/light-up-the-web-mix-essentials-2008-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

