<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tanzim Saqib on .NET discovery &#187; Volta</title>
	<atom:link href="http://tanzimsaqib.wordpress.com/category/volta/feed/" rel="self" type="application/rss+xml" />
	<link>http://tanzimsaqib.wordpress.com</link>
	<description>Innovate. Create. Share.</description>
	<lastBuildDate>Wed, 19 Nov 2008 10:04:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='tanzimsaqib.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/756ba5f132c23525771f86885e65d27c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Tanzim Saqib on .NET discovery &#187; Volta</title>
		<link>http://tanzimsaqib.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tanzimsaqib.wordpress.com/osd.xml" title="Tanzim Saqib on .NET discovery" />
		<item>
		<title>Write your own DOM friendly extension methods for HtmlElement in Volta</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/30/write-your-own-dom-friendly-extension-methods-for-htmlelement-in-volta/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/30/write-your-own-dom-friendly-extension-methods-for-htmlelement-in-volta/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 20:10:25 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/30/write-your-own-dom-friendly-extension-methods-for-htmlelement-in-volta/</guid>
		<description><![CDATA[ 
I know there are GetById, GetById&#60;&#62; methods in Document object. But, I often miss a method that I feel should be in Volta, which iterates through its child nodes and find an element for me. Let us say, there is a HTML like the following:
&#60;div id="divContainer"&#62;
    &#60;b&#62;Some text&#60;/b&#62;
    [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=57&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://tanzimsaqib.files.wordpress.com/2008/01/logo-volta.png"><img style="border-width:0;" height="75" alt="logo-volta" src="http://tanzimsaqib.files.wordpress.com/2008/01/logo-volta-thumb.png?w=189&#038;h=75" width="189" border="0"></a> </p>
<p>I know there are <strong>GetById</strong>, <strong>GetById&lt;&gt;</strong> methods in Document object. But, I often miss a method that I feel should be in Volta, which iterates through its child nodes and find an element for me. Let us say, there is a HTML like the following:</p>
<pre><span style="color:blue;">&lt;</span><span style="color:#a31515;">div </span><span style="color:red;">id</span><span style="color:blue;">="divContainer"&gt;
    &lt;</span><span style="color:#a31515;">b</span><span style="color:blue;">&gt;</span>Some text<span style="color:blue;">&lt;/</span><span style="color:#a31515;">b</span><span style="color:blue;">&gt;
    &lt;</span><span style="color:#a31515;">div </span><span style="color:red;">id</span><span style="color:blue;">="firstDiv"&gt;
        &lt;</span><span style="color:#a31515;">i</span><span style="color:blue;">&gt;</span>Some more text<span style="color:blue;">&lt;/</span><span style="color:#a31515;">i</span><span style="color:blue;">&gt;
    &lt;/</span><span style="color:#a31515;">div</span><span style="color:blue;">&gt;
    &lt;</span><span style="color:#a31515;">div </span><span style="color:red;">id</span><span style="color:blue;">="secondDiv"&gt;
        </span>Okay, I gotta go now
    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">div</span><span style="color:blue;">&gt;
    &lt;</span><span style="color:#a31515;">div </span><span style="color:red;">anyAttribute</span><span style="color:blue;">="anyValue"&gt;
        </span>Babye
    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">div</span><span style="color:blue;">&gt;
&lt;/</span><span style="color:#a31515;">div</span><span style="color:blue;">&gt;</span></pre>
<p>The most important thing is, I can not get the last div by Document.<strong>GetById</strong>, because instead of id I chose <strong>anyAttribute</strong>. So, I wrote my own extension method which can run into not only Div but also any <strong>HtmlElement</strong>, and can find me the desired <strong>HtmlElement</strong> inside the prior one with the <strong>anyAttribute</strong> and <strong>anyValue</strong>. To make my intention clear, I&#8217;d like to show how I&#8217;d like to use that extension method:
<pre><span style="color:blue;">var </span>divContainer = Document.GetById&lt;<span style="color:#2b91af;">Div</span>&gt;(<span style="color:#a31515;">"divContainer"</span>);
<span style="color:blue;">var </span>anyDiv = divContainer.Find&lt;<span style="color:#2b91af;">Div</span>&gt;(<span style="color:#a31515;">"anyAttribute"</span>, <span style="color:#a31515;">"anyValue"</span>);

<span style="color:blue;">if</span>(anyDiv != <span style="color:blue;">null</span>)
    anyDiv.InnerHtml += <span style="color:#a31515;">"guys!"</span>;</pre>
<p><a href="http://11011.net/software/vspaste"></a>So, I&#8217;d like to call my extension method <strong>Find&lt;&gt;</strong> which will take the type I&#8217;m looking for (in this case a Div) and that <strong>HtmlElement</strong> should have an attribute &#8220;<strong>anyAttribute</strong>&#8221; that contains &#8220;<strong>anyValue</strong>&#8220;. Here is how I make up the extension method:
<pre><span style="color:blue;">public static class </span><span style="color:#2b91af;">HtmlExtensions
</span>{
    <span style="color:blue;">public static </span>T Find&lt;T&gt;(<span style="color:blue;">this </span>T parent, <span style="color:blue;">string </span>attribute, <span style="color:blue;">string </span>value)
        <span style="color:blue;">where </span>T : <span style="color:#2b91af;">HtmlElement
    </span>{
        <span style="color:blue;">var </span>element = parent.FirstChild; 

        <span style="color:blue;">while</span>(element != <span style="color:blue;">null</span>)
            <span style="color:blue;">if </span>(element.IsProper&lt;T&gt;(attribute, value))
                <span style="color:blue;">return </span>element <span style="color:blue;">as </span>T;
            <span style="color:blue;">else
                </span>element = element.NextSibling; 

        <span style="color:blue;">return null</span>;
    }

    <span style="color:blue;">public static bool </span>IsProper&lt;T&gt;(<span style="color:blue;">this </span><span style="color:#2b91af;">DomNode </span>element, <span style="color:blue;">string </span>attribute, <span style="color:blue;">string </span>value)
        <span style="color:blue;">where </span>T : <span style="color:#2b91af;">HtmlElement
    </span>{
        <span style="color:blue;">if </span>(element.GetType() == <span style="color:blue;">typeof</span>(T) &amp;&amp;
            element.Attributes != <span style="color:blue;">null </span>&amp;&amp;
            element.Attributes.GetNamedItem(attribute) != <span style="color:blue;">null </span>&amp;&amp;
            element.Attributes.GetNamedItem(attribute).Value == value)

            <span style="color:blue;">return true</span>;

        <span style="color:blue;">return false</span>;
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a>This method can iterate only one depth. Multi depth implementation can be done by running a simple DFS which is left to you guys. Note one thing, I have called one extension method &#8220;<strong>IsProper</strong>&#8221; inside another extension method, and there is no harm in it. So, this is how you can add your own extension methods to the <strong>HtmlElement</strong>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=57&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/30/write-your-own-dom-friendly-extension-methods-for-htmlelement-in-volta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/01/logo-volta-thumb.png" medium="image">
			<media:title type="html">logo-volta</media:title>
		</media:content>
	</item>
		<item>
		<title>Appearing on Microsoft Volta team blog</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/27/appearing-on-microsoft-volta-team-blog/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/27/appearing-on-microsoft-volta-team-blog/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 21:59:19 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/27/appearing-on-microsoft-volta-team-blog/</guid>
		<description><![CDATA[Microsoft Volta team blogged about me and one of my articles: http://labs.live.com/volta/blog/Volta+How+To+Flickr+Widget.aspx

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=54&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Microsoft Volta team blogged about me and one of my articles: <a href="http://labs.live.com/volta/blog/Volta+How+To+Flickr+Widget.aspx" target="_blank">http://labs.live.com/volta/blog/Volta+How+To+Flickr+Widget.aspx</a>
<p><a href="http://tanzimsaqib.files.wordpress.com/2008/01/voltateamblog.png"><img style="border-width:0;" height="193" alt="VoltaTeamBlog" src="http://tanzimsaqib.files.wordpress.com/2008/01/voltateamblog-thumb.png?w=563&#038;h=193" width="563" border="0"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/54/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/54/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=54&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/27/appearing-on-microsoft-volta-team-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://tanzimsaqib.files.wordpress.com/2008/01/voltateamblog-thumb.png" medium="image">
			<media:title type="html">VoltaTeamBlog</media:title>
		</media:content>
	</item>
		<item>
		<title>HttpRequestFactory vs. XMLHttpRequest in Volta</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/25/httprequestfactory-vs-xmlhttprequest-in-volta/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/25/httprequestfactory-vs-xmlhttprequest-in-volta/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 17:09:05 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/25/httprequestfactory-vs-xmlhttprequest-in-volta/</guid>
		<description><![CDATA[HttpRequestFactory was designed for use by tiersplitting internally and was not supposed to be exposed as part of the Volta API as Danny van Velzen from Microsoft Volta team told me today. So, its better if you use XMLHttpRequest instead because this factory class might not show up in the later releases. You will find [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=41&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>HttpRequestFactory was designed for use by tiersplitting internally and was not supposed to be exposed as part of the Volta API as Danny van Velzen from Microsoft Volta team told me today. So, its better if you use XMLHttpRequest instead because this factory class might not show up in the later releases. You will find this class in Microsoft.LiveLabs.Volta.Xml namespace.&nbsp; As like as JavaScript&#8217;s one, in this .NET version you can also Open URL, specify method name, and of course pass credentials. You can track response text, xml, status code, status text and also you can abort. </p>
<p>To retrieve your content, you must subscribe to ReadyStateChange event with a HtmlEventHandler which you can find in Microsoft.LiveLabs.Volta.Html namespace and check the status code. If it is 200 that means &#8220;HTTP OK&#8221;, you can take the ResponseText or ResponseXML. See this example:</p>
<pre><span style="color:blue;">string </span>content = <span style="color:blue;">string</span>.Empty;
<span style="color:blue;">var </span>request = <span style="color:blue;">new </span><span style="color:#2b91af;">XMLHttpRequest</span>();

request.ReadyStateChange += <span style="color:blue;">delegate</span>()
{
    <span style="color:blue;">if </span>(request.Status == 200)
        content = request1.ResponseText;
};

request.Open(<span style="color:#a31515;">"POST"</span>, <span style="color:#a31515;">"http://tanzimsaqib.com/feed/"</span>, <span style="color:blue;">true</span>);</pre>
<p>However, you cannot fetch cross domain content by XMLHttpRequest. The Volta compiler creates client side JavaScript XMLHttpRequest and lets developers write code in .NET friendly way. So, I do not think there is any way to retrieve cross domain content in Volta, and leaving us on the same old HttpRequest class.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=41&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/25/httprequestfactory-vs-xmlhttprequest-in-volta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
		<item>
		<title>[New Article] Building a Volta Control : A Flickr Widget</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/18/new-article-building-a-volta-control-a-flickr-widget/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/18/new-article-building-a-volta-control-a-flickr-widget/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 15:36:31 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/18/new-article-building-a-volta-control-a-flickr-widget/</guid>
		<description><![CDATA[This is my first article which is based on the first CTP of Volta considering its current limitations. You will see how you can create a Volta control that the compiler can convert into an AJAX Widget without requiring us writing a single line of JavaScript code: http://dotnetslackers.com/articles/aspnet/BuildingAVoltaControlAFlickrWidget.aspx
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=36&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is my first article which is based on the first CTP of Volta considering its current limitations. You will see how you can create a Volta control that the compiler can convert into an AJAX Widget without requiring us writing a single line of JavaScript code: <a title="http://dotnetslackers.com/articles/aspnet/BuildingAVoltaControlAFlickrWidget.aspx" href="http://dotnetslackers.com/articles/aspnet/BuildingAVoltaControlAFlickrWidget.aspx">http://dotnetslackers.com/articles/aspnet/BuildingAVoltaControlAFlickrWidget.aspx</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=36&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/18/new-article-building-a-volta-control-a-flickr-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>
	</item>
		<item>
		<title>Make web.config work in Volta</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/08/make-webconfig-work-in-volta/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/08/make-webconfig-work-in-volta/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 21:24:20 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/08/make-webconfig-work-in-volta/</guid>
		<description><![CDATA[ 
Ever wondered how to make web.config work in Volta first CTP release? Simply add a web.config file and add content to it? Unfortunately this is not the case in Volta at least in the first CTP. Five steps to get it done:

Add a web.config file
Add content to simply by copying from other web.config file
Right [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=19&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://labs.live.com/volta/images/logo-volta.png"> </p>
<p>Ever wondered how to make web.config work in Volta first CTP release? Simply add a web.config file and add content to it? Unfortunately this is not the case in Volta at least in the first CTP. Five steps to get it done:</p>
<ol>
<li>Add a web.config file
<li>Add content to simply by copying from other web.config file
<li>Right click on web.config from the Solution Explorer and then Properties
<li>Choose Build Action to Embedded Resource
<li>In your Volta Page Designer CS file, add the following line of code: </li>
</ol>
<blockquote><pre>[<span style="color:blue;">assembly</span>: <span style="color:#2b91af;">VoltaFile</span>(<span style="color:#a31515;">"web.config"</span>)]</pre>
<p></p></blockquote>
<pre> </pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=19&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/08/make-webconfig-work-in-volta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://labs.live.com/volta/images/logo-volta.png" medium="image" />
	</item>
		<item>
		<title>Make HTML controls discoverable in Volta Control</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/03/make-html-controls-discoverable-in-volta-control/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/03/make-html-controls-discoverable-in-volta-control/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 02:12:42 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/03/make-html-controls-discoverable-in-volta-control/</guid>
		<description><![CDATA[&#160;
When a Volta control is rendered, the ID attribute of the generated HTML is changed to something like _vcId_1_DivName which is inconvenient to find from code. But the ID attribute stays the same in case of Volta Page, so it is discoverable by ID like this:
Div divContent = Document.GetById&#60;Div&#62;("divContent");

However, if you add HTML controls to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=35&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://labs.live.com/volta/images/logo-volta.png">&nbsp;</p>
<p>When a Volta control is rendered, the ID attribute of the generated HTML is changed to something like _vcId_1_DivName which is inconvenient to find from code. But the ID attribute stays the same in case of Volta Page, so it is discoverable by ID like this:</p>
<pre><span style="color:#2b91af;">Div </span>divContent = Document.GetById&lt;<span style="color:#2b91af;">Div</span>&gt;(<span style="color:#a31515;">"divContent"</span>);</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>However, if you add HTML controls to the control like the following, the ID is not changed during the rendering:</p>
<pre><span style="color:blue;">public </span>VoltaControl1() : <span style="color:blue;">base</span>(<span style="color:#a31515;">"VoltaControl1.html"</span>)
{
    InitializeComponent();

    <span style="color:#2b91af;">Button </span>btnClick = <span style="color:blue;">new </span><span style="color:#2b91af;">Button</span>();
    btnClick.InnerText = <span style="color:#a31515;">"Click!"</span>;
    btnClick.Id = <span style="color:#a31515;">"btnClick"</span>;
    <span style="color:blue;">this</span>.Add(btnClick);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>If you don&#8217;t prefer this way and seriously want to write your own HTML in the control&#8217;s html page, you might find the following snippet useful. But, remember in this case you will use name attribute of the html element instead of ID.</p>
<pre><span style="color:green;">// Usage: var element = GetElementByName(Document.GetElementsByTagName("div"), "divWidget");
</span><span style="color:blue;">private </span><span style="color:#2b91af;">HtmlElement </span>GetElementByName(<span style="color:#2b91af;">HtmlElementCollection </span>elements, <span style="color:blue;">string </span>name)
{
    <span style="color:blue;">foreach </span>(<span style="color:blue;">var </span>element <span style="color:blue;">in </span>elements)
    {
        <span style="color:#2b91af;">DomAttribute </span>nameAttribute = element.Attributes.GetNamedItem(<span style="color:#a31515;">"name"</span>);
        <span style="color:blue;">if </span>(nameAttribute != <span style="color:blue;">null</span>)
            <span style="color:blue;">if </span>(nameAttribute.Value == name)
                <span style="color:blue;">return </span>element;
    }

    <span style="color:blue;">return null</span>;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=35&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/03/make-html-controls-discoverable-in-volta-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://labs.live.com/volta/images/logo-volta.png" medium="image" />
	</item>
		<item>
		<title>Making cross domain AJAX call using Volta</title>
		<link>http://tanzimsaqib.wordpress.com/2008/01/02/making-cross-domain-ajax-call-using-volta/</link>
		<comments>http://tanzimsaqib.wordpress.com/2008/01/02/making-cross-domain-ajax-call-using-volta/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 06:56:51 +0000</pubDate>
		<dc:creator>tanzimsaqib</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Volta]]></category>

		<guid isPermaLink="false">http://tanzimsaqib.wordpress.com/2008/01/02/making-cross-domain-ajax-call-using-volta/</guid>
		<description><![CDATA[&#160;
Making a cross domain AJAX call in Volta is piece of cake. Volta compiler generates necessary client codes to make it work. Here is a snippet that can make an AJAX call to some Url and fetch data:
public void DownloadPhotos()
{
    IHttpRequest request = HttpRequestFactory.Create();
    request.AsyncSend("POST", URL, string.Empty,
   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=34&subd=tanzimsaqib&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://labs.live.com/volta/images/logo-volta.png">&nbsp;</p>
<p>Making a cross domain AJAX call in Volta is piece of cake. Volta compiler generates necessary client codes to make it work. Here is a snippet that can make an AJAX call to some Url and fetch data:</p>
<pre><span style="color:blue;">public void </span>DownloadPhotos()
{
    <span style="color:#2b91af;">IHttpRequest </span>request = <span style="color:#2b91af;">HttpRequestFactory</span>.Create();
    request.AsyncSend(<span style="color:#a31515;">"POST"</span>, URL, <span style="color:blue;">string</span>.Empty,
        <span style="color:blue;">delegate</span>(<span style="color:blue;">string </span>response)
        {
            OnPhotosLoaded(<span style="color:blue;">new </span><span style="color:#2b91af;">PhotosLoadedEventArgs</span>(response));
        });
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Both IHttpRequest and HttpRequestFactory classes can be found in the Microsoft.LiveLabs.Volta.MultiTier namespace. AsyncSend method performs the asynchronous call and calls back the delegate defined where OnPhotosLoaded event is fired to notify the subscriber of this event that the data has just arrived.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tanzimsaqib.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tanzimsaqib.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tanzimsaqib.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tanzimsaqib.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tanzimsaqib.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tanzimsaqib.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tanzimsaqib.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tanzimsaqib.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tanzimsaqib.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tanzimsaqib.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tanzimsaqib.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tanzimsaqib.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tanzimsaqib.wordpress.com&blog=1242602&post=34&subd=tanzimsaqib&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tanzimsaqib.wordpress.com/2008/01/02/making-cross-domain-ajax-call-using-volta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d65a9fc0993ccb92b3897422dbf28d84?s=96&#38;d=identicon" medium="image">
			<media:title type="html">tanzimsaqib</media:title>
		</media:content>

		<media:content url="http://labs.live.com/volta/images/logo-volta.png" medium="image" />
	</item>
	</channel>
</rss>