﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
  <channel>
    <title>Eduardo Campañó</title>
    <description>a developer's blog </description>
    <link>http://www.sectorsiete.com/eduardocampano/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.sectorsiete.com/eduardocampano/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Eduardo Campañó</dc:creator>
    <dc:title>Eduardo Campañó</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <item>
      <title>Getting Json result from a controller in ASP.NET MVC</title>
      <description>&lt;div class="post-text"&gt;
&lt;p&gt;
I noticed a Json method in the Controller class so I had to play around with it. It looks really usefull if you&amp;#39;re using some Javascript libraries that use Json for loading data. I wanted to have the same action wich returns different content based on the extension requested in the query string, to render the full page if no format is required and Json if a .js is at the end. So my routes should be like: 
&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;controller&lt;/span&gt;&lt;span class="pun"&gt;}/{&lt;/span&gt;&lt;span class="pln"&gt;action&lt;/span&gt;&lt;span class="pun"&gt;}.{&lt;/span&gt;&lt;span class="pln"&gt;format&lt;/span&gt;&lt;span class="pun"&gt;} // i.e. Categories/&lt;/span&gt;&lt;span class="pln"&gt;List.js&lt;/span&gt;&lt;/code&gt;
&lt;/pre&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;controller&lt;/span&gt;&lt;span class="pun"&gt;}/{&lt;/span&gt;&lt;span class="pln"&gt;action&lt;/span&gt;&lt;span class="pun"&gt;} // i.e. Categories/List&lt;/span&gt;&lt;/code&gt;
&lt;/pre&gt;
I could have used {controller}/{action}.js but I&amp;#39;d rather leave it open for other formats. 
So the code in Global.asax.cs:
&lt;pre class="prettyprint"&gt;
routes.MapRoute(&amp;quot;FormatedCategories&amp;quot;,
&amp;quot;{controller}/{action}.{format}&amp;quot;,
new { controller = &amp;quot;Home&amp;quot;, action = &amp;quot;Index&amp;quot;, format = &amp;quot;&amp;quot; }
);
routes.MapRoute(&amp;quot;Default&amp;quot;,
&amp;quot;{controller}/{action}&amp;quot;,
new { controller = &amp;quot;Home&amp;quot;, action = &amp;quot;Index&amp;quot;, format = &amp;quot;&amp;quot; }
);
&lt;/pre&gt;
Finally the action:
&lt;pre class="prettyprint"&gt;
&lt;code&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ActionResult&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;List&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;string&lt;/span&gt;&lt;span class="pln"&gt; format&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="com"&gt;// get the catagories list&lt;/span&gt;&lt;span class="pln"&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;string&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;IsNullOrEmpty&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;format&lt;/span&gt;&lt;span class="pun"&gt;))&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;View&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;format &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;quot;js&amp;quot;&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Json&lt;/span&gt;&lt;span class="pun"&gt;(categories_list&lt;/span&gt;&lt;span class="pln"&gt;&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/code&gt;
&lt;/pre&gt;
I really like how ASP.NET MVC leaves you control over the behaviour of the application when it&amp;#39;s needed. Now I&amp;#39;m thinking to create a Base Controller or a Filter Attribute to handle every action and serialize the view data if the format is specified, or render RSS xml as another format.
&lt;/div&gt;
</description>
      <link>http://www.sectorsiete.com/eduardocampano/post/2008/12/07/Getting-Json-result-from-a-controller-in-ASPNET-MVC.aspx</link>
      <author>eduardo.campano.nospam@nospam.yahoo.com.ar (eduardo.campano)</author>
      <comments>http://www.sectorsiete.com/eduardocampano/post/2008/12/07/Getting-Json-result-from-a-controller-in-ASPNET-MVC.aspx#comment</comments>
      <guid>http://www.sectorsiete.com/eduardocampano/post.aspx?id=8ba3c0d5-9114-4e18-a9ea-21526950cccf</guid>
      <pubDate>Sun, 07 Dec 2008 20:02:00 -0300</pubDate>
      <category>asp.net</category>
      <dc:publisher>eduardo.campano</dc:publisher>
      <pingback:server>http://www.sectorsiete.com/eduardocampano/pingback.axd</pingback:server>
      <pingback:target>http://www.sectorsiete.com/eduardocampano/post.aspx?id=8ba3c0d5-9114-4e18-a9ea-21526950cccf</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sectorsiete.com/eduardocampano/trackback.axd?id=8ba3c0d5-9114-4e18-a9ea-21526950cccf</trackback:ping>
      <wfw:comment>http://www.sectorsiete.com/eduardocampano/post/2008/12/07/Getting-Json-result-from-a-controller-in-ASPNET-MVC.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sectorsiete.com/eduardocampano/syndication.axd?post=8ba3c0d5-9114-4e18-a9ea-21526950cccf</wfw:commentRss>
    </item>
    <item>
      <title>Running applications with different regional settings</title>
      <description>&lt;p&gt;
We had two windows desktop applications that needed different regional 
settings to work properly. Since neither is a .NET application we couldn&amp;rsquo;t 
change the CultureInfo. Another requirement was that users should be able to 
have both applications running at the same so we discarded changing regional 
settings before running each application. 
&lt;/p&gt;
&lt;p&gt;
After some web research I found that regional settings are stored by user in 
the windows registry, the key is HKEY_CURRENT_USER\Control Panel\International. 
That suggested me that we could create another user account, set it&amp;rsquo;s regional 
settings and run one of the applications with this account. The command line to 
do this is:
&lt;/p&gt;
&lt;pre&gt;
runas /u:DOMAIN\user /savecred C:\Program.exe
&lt;/pre&gt;
&lt;p&gt;
It will ask you for the DOMAIN\user password the only first time you run it. 
Of course, the secondary logon service must be running on the computer.
&lt;/p&gt;
&lt;p&gt;
That&amp;rsquo;s it. Problem solved. 
&lt;/p&gt;
</description>
      <link>http://www.sectorsiete.com/eduardocampano/post/2008/11/11/Running-applications-with-different-regional-settings.aspx</link>
      <author>eduardo.campano.nospam@nospam.yahoo.com.ar (eduardo.campano)</author>
      <comments>http://www.sectorsiete.com/eduardocampano/post/2008/11/11/Running-applications-with-different-regional-settings.aspx#comment</comments>
      <guid>http://www.sectorsiete.com/eduardocampano/post.aspx?id=1c81cac3-6960-4779-beb7-38d0fe7ecee0</guid>
      <pubDate>Tue, 11 Nov 2008 16:49:00 -0300</pubDate>
      <category>Windows</category>
      <dc:publisher>eduardo.campano</dc:publisher>
      <pingback:server>http://www.sectorsiete.com/eduardocampano/pingback.axd</pingback:server>
      <pingback:target>http://www.sectorsiete.com/eduardocampano/post.aspx?id=1c81cac3-6960-4779-beb7-38d0fe7ecee0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sectorsiete.com/eduardocampano/trackback.axd?id=1c81cac3-6960-4779-beb7-38d0fe7ecee0</trackback:ping>
      <wfw:comment>http://www.sectorsiete.com/eduardocampano/post/2008/11/11/Running-applications-with-different-regional-settings.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sectorsiete.com/eduardocampano/syndication.axd?post=1c81cac3-6960-4779-beb7-38d0fe7ecee0</wfw:commentRss>
    </item>
    <item>
      <title>BlogEngine.NET tuning</title>
      <description>&lt;p&gt;
I wanted the blog to have a database data structure, so the only thing I needed to do was change the DefaultProvider to DbBlogProvider, DefaultRoleProvider to DbRoleProvider and DefaultMembershipProvider to DbMembershipProvider. I made use of the table prefix feature just in case to be able to make tests without touching this production blog. Then run the database creation script, set up the database connection string and that&amp;#39;s it. Pretty easy.
&lt;/p&gt;
&lt;p&gt;
I was curious to change the compression method to Gzip, because after &lt;a href="http://www.codinghorror.com/blog/archives/001178.html"&gt;reading some compression benchmarking tests&lt;/a&gt; I just wanted to have a look. Yes I have to make the benchmark myself, but I see more websites going to Gzip rather than deflate. Oops, BlogEngine doesn&amp;rsquo;t allow to change the compression method throw configuration in it&amp;rsquo;s current version (1.4.5). If deflate is accepted then deflate is used, and gzip is the second option if it&amp;rsquo;s accepted. 
&lt;/p&gt;
&lt;p&gt;
I made my own theme, I hope you like it. I still have a lot of changes to make, but the main view is almost as I imagined. I made extensive use of PNG images and standard CSS 2.1 with some mozilla hacks, so it must look horrible in IE6. That&amp;rsquo;s the next step. I&amp;rsquo;m not expecting to render exactly the same in IE6 but at least the PNGs have a simple workaround.
&lt;/p&gt;
</description>
      <link>http://www.sectorsiete.com/eduardocampano/post/2008/11/03/BlogEngineNET-tuning.aspx</link>
      <author>eduardo.campano.nospam@nospam.yahoo.com.ar (eduardo.campano)</author>
      <comments>http://www.sectorsiete.com/eduardocampano/post/2008/11/03/BlogEngineNET-tuning.aspx#comment</comments>
      <guid>http://www.sectorsiete.com/eduardocampano/post.aspx?id=26c3de2b-8830-4092-9d65-cdad74f6552d</guid>
      <pubDate>Mon, 03 Nov 2008 12:16:00 -0300</pubDate>
      <category>BlogEngine.NET</category>
      <dc:publisher>eduardo.campano</dc:publisher>
      <pingback:server>http://www.sectorsiete.com/eduardocampano/pingback.axd</pingback:server>
      <pingback:target>http://www.sectorsiete.com/eduardocampano/post.aspx?id=26c3de2b-8830-4092-9d65-cdad74f6552d</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sectorsiete.com/eduardocampano/trackback.axd?id=26c3de2b-8830-4092-9d65-cdad74f6552d</trackback:ping>
      <wfw:comment>http://www.sectorsiete.com/eduardocampano/post/2008/11/03/BlogEngineNET-tuning.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sectorsiete.com/eduardocampano/syndication.axd?post=26c3de2b-8830-4092-9d65-cdad74f6552d</wfw:commentRss>
    </item>
    <item>
      <title>Welcome</title>
      <description>&lt;p&gt;This is my very first post and I&amp;rsquo;ll try to explain what I&amp;rsquo;m doing here. Now that I graduated I&amp;#39;m free to start doing the things I like. The main reason of this blog is learning. I read a LOT and I&amp;rsquo;m what is called an early adopter, so this blog will be to write about everything I find interesting. Right now, my interest go for:   &lt;/p&gt;&lt;ul&gt;	&lt;li&gt;Programming in general&amp;nbsp;&lt;/li&gt;		&lt;li&gt;C#&amp;nbsp;&lt;/li&gt;		&lt;li&gt;ASP.NET&amp;nbsp;&lt;/li&gt;		&lt;li&gt;ASP.NET Ajax&amp;nbsp;&lt;/li&gt;		&lt;li&gt;ASP.NET Mvc&amp;nbsp;&lt;/li&gt;		&lt;li&gt;IIS&amp;nbsp;&lt;/li&gt;		&lt;li&gt;ASP.NET and IIS optimization&amp;nbsp;&lt;/li&gt;		&lt;li&gt;DDD, TDD &amp;amp; BDD&amp;nbsp;&lt;/li&gt;		&lt;li&gt;SEO &lt;/li&gt; &lt;/ul&gt;&lt;p&gt;Not that I&amp;#39;m a Microsoft fan but a few years ago I needed to narrow my interests to get better and also because the company I work for is a Microsoft partner.&lt;/p&gt;&lt;p&gt;I&amp;#39;m from Argentina and my country language is Spanish, so, why would I write in English? Yes, my English sucks but a reason this blog is in English is trying to make it suck less. &lt;/p&gt;&lt;p&gt;There is a long way to go to get this blog working the way I&amp;#39;m planning and I&amp;#39;ll be posting about the improvements and changes made to keep the record. Probably in a few years I&amp;#39;d look back and be ashamed of what I did and I think it&amp;#39;s all part of the process. &lt;/p&gt;&lt;p&gt;I&amp;rsquo;ll try to do my best, but I&amp;rsquo;m not so smart so don&amp;rsquo;t expect that much.&lt;/p&gt;</description>
      <link>http://www.sectorsiete.com/eduardocampano/post/2008/10/19/Welcome.aspx</link>
      <author>eduardo.campano.nospam@nospam.yahoo.com.ar (eduardo.campano)</author>
      <comments>http://www.sectorsiete.com/eduardocampano/post/2008/10/19/Welcome.aspx#comment</comments>
      <guid>http://www.sectorsiete.com/eduardocampano/post.aspx?id=110d3086-d217-44c0-9d18-6bf7c96a0004</guid>
      <pubDate>Sun, 19 Oct 2008 23:28:00 -0300</pubDate>
      <category>General</category>
      <dc:publisher>eduardo.campano</dc:publisher>
      <pingback:server>http://www.sectorsiete.com/eduardocampano/pingback.axd</pingback:server>
      <pingback:target>http://www.sectorsiete.com/eduardocampano/post.aspx?id=110d3086-d217-44c0-9d18-6bf7c96a0004</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sectorsiete.com/eduardocampano/trackback.axd?id=110d3086-d217-44c0-9d18-6bf7c96a0004</trackback:ping>
      <wfw:comment>http://www.sectorsiete.com/eduardocampano/post/2008/10/19/Welcome.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sectorsiete.com/eduardocampano/syndication.axd?post=110d3086-d217-44c0-9d18-6bf7c96a0004</wfw:commentRss>
    </item>
  </channel>
</rss>