<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Hajan Selmani</title><link>https://weblogs.asp.net:443/hajan/</link><description>CEO &amp; Founder of HASELT, Microsoft MVP in ASP.NET/IIS</description><item><title>Microsoft patterns &amp; practices team adopts the Open Development Model for all Enterprise Library application blocks</title><link>https://weblogs.asp.net:443/hajan/microsoft-patterns-amp-practices-team-adopts-the-open-development-model-for-all-enterprise-library-application-blocks</link><description>Happy new 2014 year to everyone!
&lt;p&gt;This is my first post in 2014 year followed by great news which happened recently...&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://entlib.codeplex.com/" target="_blank"&gt;Enterprise Library now welcomes community contributions&lt;/a&gt;, as Microsoft patterns &amp; practices team adopts the Open Development Model for all Enterprise Library application blocks.
&lt;/p&gt;
&lt;p&gt;You can read more at the official &lt;a href="http://blogs.msdn.com/b/agile/archive/2013/11/21/microsoft-enterprise-library-open-development-model.aspx" target="_blank"&gt;public announcement&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;
 If you want to engage with Microsoft patterns &amp; practices and give your contributions back to the Enterprise Library, follow the link &lt;a href="http://entlib.codeplex.com/" target="_blank"&gt;http://entlib.codeplex.com/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Hajan
&lt;/p&gt;</description><pubDate>Mon, 06 Jan 2014 22:49:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/microsoft-patterns-amp-practices-team-adopts-the-open-development-model-for-all-enterprise-library-application-blocks</guid><category>Community News</category><category>enterprise library</category><category>Microsoft</category><category>patterns amp; practices</category></item><item><title>My speaking engagement at jQuery Bulgaria 2013</title><link>https://weblogs.asp.net:443/hajan/my-speaking-engagement-at-jquery-bulgaria</link><description>&lt;p class="date"&gt;&lt;em&gt;30 November 2013&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'm writing this blog post after the jQuery Bulgaria event which took place today in Sofia. The event was organized by Infragistics guys, but supported by many known companies. The event had few hundred attendees and was quite nice place to share, network and learn.&lt;/p&gt;

&lt;p&gt;There was a&amp;nbsp;lot of crowd in the event...&lt;/p&gt;

&lt;p&gt;&lt;img style="width: 460px; height: 240px;" src="https://s5bjow.dm1.livefilestore.com/y2mV6Ickwr9Hu7xmboJzWDIradco6I5UiC4fIY2EM0hLfQUYNAlMBsuY9MJxp0vJyAs8d9BvsD3Dg32EaHhI4_07FuD8JSEH9edPODv_0f89DgKYKVSaE9rCjBmQmFBodOq/presentation_2.jpg" mce_src="https://s5bjow.dm1.livefilestore.com/y2mV6Ickwr9Hu7xmboJzWDIradco6I5UiC4fIY2EM0hLfQUYNAlMBsuY9MJxp0vJyAs8d9BvsD3Dg32EaHhI4_07FuD8JSEH9edPODv_0f89DgKYKVSaE9rCjBmQmFBodOq/presentation_2.jpg"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;...mainly developers and IT professionals from Sofia, Bulgaria.&lt;/p&gt;

&lt;p&gt;We were few guys from Macedonia, our crew of eight and few others we meet during the event on my sessions ;).&lt;/p&gt;

&lt;p&gt;&lt;img style="width: 480px; height: 270px;" src="https://s5bjow.dm2302.livefilestore.com/y2mg1IpjI3HT__N51hnLliSDAzXtDm2iILTMJ-_U2rc7WxjYbC_438Q7xze3t3KcKNUOBS-BOp4NlNm9ivfuHyZe6f2boMzVuYXCxofOzjOycCY4KISLMwE1et_Jq_T9kbM/haselt_team_1.jpg" mce_src="https://s5bjow.dm2302.livefilestore.com/y2mg1IpjI3HT__N51hnLliSDAzXtDm2iILTMJ-_U2rc7WxjYbC_438Q7xze3t3KcKNUOBS-BOp4NlNm9ivfuHyZe6f2boMzVuYXCxofOzjOycCY4KISLMwE1et_Jq_T9kbM/haselt_team_1.jpg"&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The photo was made right after my second session "jQuery Ajax - Tips &amp;amp; Tricks"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;
At this event, I had two speeches, delivering two interesting sessions:
&lt;/p&gt;

&lt;ul&gt;
 
&lt;li&gt;&lt;strong&gt;Building ambitious apps with Ember.js, jQuery, and Web API 2&lt;/strong&gt;&lt;/li&gt;
 
&lt;li&gt;&lt;strong&gt;jQuery Ajax - Tips and Tricks&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
During both sessions, I had a lot of live coding in Visual Studio by showing off the capabilities of Visual Studio 2013 in writing JavaScript, jQuery and syntax for other JavaScript-based libraries such as Ember.js&lt;/p&gt;
&lt;h4&gt;The first session: Building ambitious apps with Ember.js, jQuery, and Web API 2&lt;/h4&gt;
&lt;p&gt;&lt;img width="480" height="270" style="width: 480px; height: 270px;" src="https://s5bjow.dm2302.livefilestore.com/y2mrsGmAQzQoWcN_ZSyQvxPI3vAsj8bA43P4MrYCkWf5qS-2nX1aiOyxVZwsGluJhbr_AH4cXKPBsop_ja4jTjABNDa2hKqSomHzkBzUZ6U1tlszLATjOan6ezCLDuknJad/presentation_4.jpg" mce_src="https://s5bjow.dm2302.livefilestore.com/y2mrsGmAQzQoWcN_ZSyQvxPI3vAsj8bA43P4MrYCkWf5qS-2nX1aiOyxVZwsGluJhbr_AH4cXKPBsop_ja4jTjABNDa2hKqSomHzkBzUZ6U1tlszLATjOan6ezCLDuknJad/presentation_4.jpg"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p mce_keep="true"&gt;The first session started at 1:30PM after the lunch break. I presented a lot of interesting stuff, little bit about jQuery and JavaScript and much more about Ember.js and how it works by writing the entire code in Visual Studio 2013 and taking advantage of the VS2013 intellisense by using the libs references.&lt;/p&gt;

&lt;p&gt;&lt;a title="PPTX - Building ambitious apps with Ember.js, jQuery and Web API" href="http://sdrv.ms/1hrdC1t" target="_blank" mce_href="http://sdrv.ms/1hrdC1t"&gt;PRESENTATION&lt;/a&gt; | &lt;a title="RAR - Demo Files" href="http://sdrv.ms/1bbNort" target="_blank" mce_href="http://sdrv.ms/1bbNort"&gt;DEMO FILES&lt;/a&gt;&lt;/p&gt;

&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;
&lt;h4&gt;The second session: jQuery Ajax - Tips and Tricks&lt;/h4&gt;
&lt;p&gt;
 &lt;img width="480" height="270" style="width: 480px; height: 270px;" src="https://s5bjow.dm2302.livefilestore.com/y2mMgv9TeZgwUh74tmqMyQPzW-uePfYU0oa1I4Q3w0VkT19l0MbF6Su0pNf97TwPGgmgB6jsp1UDZZ1oJxMbQWfu4Qit3JbSw33zASCZ7zlkzOIFaMsUcZ_5hK4qDMQroXI/presentation_5.jpg" mce_src="https://s5bjow.dm2302.livefilestore.com/y2mMgv9TeZgwUh74tmqMyQPzW-uePfYU0oa1I4Q3w0VkT19l0MbF6Su0pNf97TwPGgmgB6jsp1UDZZ1oJxMbQWfu4Qit3JbSw33zASCZ7zlkzOIFaMsUcZ_5hK4qDMQroXI/presentation_5.jpg"&gt;&lt;/p&gt;

&lt;p&gt;This was kind of much more relaxed session, where I had little bit of slides but a lot more talking and&amp;nbsp;showing&amp;nbsp;code&amp;nbsp;snippets&amp;nbsp;in Visual Studio 2013 and its&amp;nbsp;JS and HTML editors. Actually, I took ten scenarios in which I showed important things jQuery Ajax developers should have in mind, take advantage off and improve their skills in using the jQuery Ajax API and it's capabilities.

&lt;p&gt;
 &lt;a title="PPTX - jQuery Tips &amp;amp; Tricks" href="http://sdrv.ms/1hrdDTd" target="_blank" mce_href="http://sdrv.ms/1hrdDTd"&gt;PRESENTATION&lt;/a&gt; | &lt;a title="RAR - Demo Files" href="http://sdrv.ms/1bbNort" target="_blank" mce_href="http://sdrv.ms/1bbNort"&gt;DEMO FILES&lt;/a&gt;&lt;/p&gt;

&lt;p mce_keep="true"&gt;&lt;img width="480" height="270" style="width: 480px; height: 270px;" src="https://s5bjow.dm1.livefilestore.com/y2mfF5_LkLhCXyoOG-4ylaYuMNxsqwf9WerVYY-RzXKMpcPUzQCzpBLzoYxanL9JLFJ_c2N3Wv2FC6CjmIEFjzJz7LkNRmtguRJxHvu4ELdA-ROwNwyeUlX0YNunkWXycK6/presentation_6.jpg" mce_src="https://s5bjow.dm1.livefilestore.com/y2mfF5_LkLhCXyoOG-4ylaYuMNxsqwf9WerVYY-RzXKMpcPUzQCzpBLzoYxanL9JLFJ_c2N3Wv2FC6CjmIEFjzJz7LkNRmtguRJxHvu4ELdA-ROwNwyeUlX0YNunkWXycK6/presentation_6.jpg"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;
 The event was excellent. I had chance to meet a lot of new&amp;nbsp;people, Microsoft MVPs and&amp;nbsp;friends... Radi, Mihail, Jason and bunch of other guys&amp;nbsp;from the past events and conferences.&lt;/p&gt;

&lt;p&gt;
As the organizers are interested to organize this event next year again, I'm looking forward to&amp;nbsp;come back&amp;nbsp;with some new knowledge and experience to share.
&lt;br&gt;&lt;br&gt;
With Best,&lt;br&gt;
Hajan&lt;/p&gt;

&lt;p class="date"&gt;&lt;em&gt;Last update:&amp;nbsp;Sunday&amp;nbsp;December 1, 2013 7:14pm&amp;nbsp;(CET)&lt;/em&gt;&lt;/p&gt;
</description><pubDate>Sat, 30 Nov 2013 19:27:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/my-speaking-engagement-at-jquery-bulgaria</guid><category>ASP.NET</category><category>Community News</category><category>Ember.js</category><category>JavaScript</category><category>jQuery</category><category>Web Api</category></item><item><title>Microsoft MVP 2013 - ASP.NET/IIS</title><link>https://weblogs.asp.net:443/hajan/microsoft-mvp-2013-asp-net-iis</link><description>&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Microsoft MVP 2013&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;img width="352" height="142" src="https://aspblogs.blob.core.windows.net/media/hajan/badges/MVP550x222.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/badges/MVP550x222.png"&gt;&lt;/p&gt;&lt;p&gt;I AM VERY PLEASED TO ANNOUNCE THAT&amp;nbsp;I'VE BEEN AWARDED &lt;strong&gt;MICROSOFT MVP 2013&amp;nbsp;- ASP.NET/IIS&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I'm honored and it feels great to see this kind of appreciation for what we do in community.&lt;/p&gt;&lt;p&gt;This is my third year in a row being&amp;nbsp;Microsoft MVP and getting the email from Microsoft feels exactly the same as the very first one... I'm pleased and really happy to be awarded again.&lt;/p&gt;&lt;p&gt;And, here is part of the email message I got:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Dear Hajan Selmani,       &lt;br&gt;&lt;br&gt;Congratulations! We are pleased to present you with the 2013 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in ASP.NET/IIS technical communities during the past year.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;&lt;p&gt;I would like to say a great THANK YOU to everyone who supports me in the quest&amp;nbsp;of sharing and caring about others in community. A special &lt;strong&gt;THANK YOU to Microsoft&lt;/strong&gt; who brings us this opportunity to encourage our work and increase our enthusiasm to create better community and&amp;nbsp;make great impact through the products and technologies&amp;nbsp;they innovate. Thanks to&amp;nbsp;Yulia Belyanina &amp;amp; Alessandro Teglia for their leadership!&amp;nbsp;Thanks to my family, friends,&amp;nbsp;colleagues, students, acquaintances and&amp;nbsp;all stakeholders who are directly or indirectly involved in my network&amp;nbsp;and deserve respect&amp;nbsp;for my success to getting awarded again with the most prestigious award in community, &lt;strong&gt;Microsoft MVP&lt;/strong&gt;.&lt;/p&gt;&lt;p mce_keep="true"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;THANK YOU!&lt;/p&gt;  &lt;p&gt;Hajan&lt;/p&gt;</description><pubDate>Mon, 01 Jul 2013 14:28:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/microsoft-mvp-2013-asp-net-iis</guid><category>ASP.NET</category><category>Community News</category><category>IIS</category><category>MVP</category></item><item><title>INETA Speaker</title><link>https://weblogs.asp.net:443/hajan/ineta-speaker</link><description>&lt;p&gt;Great news. I'm now part of INETA Speakers Bureau - &lt;a href="http://europe.ineta.org/" target="_blank"&gt;http://europe.ineta.org/&lt;/a&gt; &amp;&amp; &lt;a href="http://europe.ineta.org/Resources/SpeakerBureau/tabid/163/Default.aspx" target="_blank"&gt;http://europe.ineta.org/Resources/SpeakerBureau/tabid/163/Default.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;INETA is a non-profit, independent organization, chartered with supporting all user groups interested in Microsoft .NET platform. INETA is run by a board of user group leaders, elected by their peers, and supported by Microsoft Corporation and other sponsors.&lt;/p&gt;

&lt;p&gt;The INETA Europe Speaker Bureau provides usergroup leaders top notch speakers for their key events. The speakers are provided at no cost to the usergroup.&lt;/p&gt;</description><pubDate>Wed, 05 Jun 2013 06:31:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/ineta-speaker</guid><category>Community News</category><category>INETA</category></item><item><title>Quick tip: How to get started quickly with OOP-like coding style in JavaScript?</title><link>https://weblogs.asp.net:443/hajan/quick-tip-how-to-get-started-quickly-with-oop-like-coding-style-in-javascript</link><description>&lt;p&gt;Writing JavaScript code in OOP style is something which is actively promoted in the last few years...&lt;/p&gt;&lt;p&gt;How to get started quickly with simple and straight forward example? Look at this one:&lt;br&gt;&lt;br&gt;&lt;strong&gt;var Hobbit = function(name){&lt;br&gt;&amp;nbsp;&amp;nbsp; this.Name = name;&lt;br&gt;&amp;nbsp;&amp;nbsp; var steps = 0;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp; this.Run = function(speed, distance){&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //hobbit running algorithm goes here&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(steps &amp;lt; distance){&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(steps); //for debugging purpose only&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; steps+=speed;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;//all members containing&amp;nbsp;&lt;strong&gt;this&lt;/strong&gt; keyword are &lt;strong&gt;&lt;u&gt;public&lt;/u&gt;&lt;/strong&gt; members. Therefore we have one property &lt;strong&gt;Name&lt;/strong&gt;&amp;nbsp;which is public, and function/method &lt;strong&gt;Run&lt;/strong&gt; accepting two parameters &lt;u&gt;speed&lt;/u&gt; and &lt;u&gt;distance&lt;/u&gt;, which is also public.&amp;nbsp;See the usage bellow.&amp;nbsp;&lt;/p&gt;&lt;p&gt;//implementation&lt;br&gt;&lt;strong&gt;var frodo = new Hobbit("Frodo");&lt;br&gt;console.log(frodo.Name);&lt;/strong&gt; //prints "Frodo"&lt;/p&gt;&lt;p&gt;//you can call the Run function/method too&lt;br&gt;&lt;strong&gt;frodo.Run(10, 2000);&lt;/strong&gt; //prints all the iterations inside 'while' with the current 'steps' value&lt;/p&gt;&lt;p&gt;...and yes, you can create new closed 'things' representations, instantiate one inside other and do entire way of OOP-like development.&amp;nbsp;&lt;/p&gt;&lt;p mce_keep="true"&gt;I'm sure this was pretty straight forward, simple and easy to understand.&lt;/p&gt;&lt;p mce_keep="true"&gt;Happy Coding!&lt;br&gt;Hajan&lt;/p&gt;</description><pubDate>Thu, 21 Mar 2013 01:33:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/quick-tip-how-to-get-started-quickly-with-oop-like-coding-style-in-javascript</guid><category>JavaScript</category><category>OOP</category></item><item><title>Quick tip: How to Make Ninject work with ASP.NET Web API</title><link>https://weblogs.asp.net:443/hajan/quick-tip-how-to-make-ninject-work-with-asp-net-web-api</link><description>&lt;p&gt;Dependency Injection is something which comes along with almost every new project we are building nowadays. I've recently used Web API several times from it's alpha version and now to the latest versions... With each new version, there were some updates to Ninject in order to make it work properly and be easily configurable with Web API mechanism. It's very natural to use Dependency Injection with Web API as it's also based on Controllers same as in any ASP.NET MVC application.&lt;/p&gt;

&lt;p&gt;The latest Web Api version could be installed directly from NuGet by running the following command:&lt;/p&gt;

&lt;p&gt;PM&gt; &lt;b&gt;Install-Package AspNetWebApi&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The current version I've installed is &lt;b&gt;v4.0.20710.0&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Previously, there were bunch of specific Ninject NuGet packages dedicated for WebAPI, however these were made for the primary alpha versions, thus the current package you &lt;u&gt;only&lt;/u&gt; need to install is the following:&lt;/p&gt;
&lt;p&gt;PM&gt; &lt;b&gt;Install-Package Ninject.WebApi.DependencyResolver&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This package will install all it's dependent packages: &lt;/p&gt;
&lt;i&gt;Log&lt;/i&gt;
&lt;p&gt;PM&gt; Install-Package Ninject.WebApi.DependencyResolver&lt;br /&gt;
Attempting to resolve dependency 'Ninject.Web.Common (≥ 3.0.0.7)'.&lt;br /&gt;
Attempting to resolve dependency 'Ninject (≥ 3.0.0.0 &amp;&amp; &lt; 3.1.0.0)'.&lt;br /&gt;
Attempting to resolve dependency 'WebActivator (≥ 1.5)'.&lt;br /&gt;
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'&lt;/p&gt;
&lt;p&gt;
Once installed, you will get NinjectWebCommon.cs inside App_Start. Open that file and add the following line inside &lt;b&gt;CreateKernel()&lt;/b&gt; method right after RegisterServices(kernel);
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;System.Web.Http.GlobalConfiguration.Configuration.DependencyResolver = new Ninject.WebApi.DependencyResolver.NinjectDependencyResolver(kernel);&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Now, you can freely create your dependency injection binding maps and take advantage of DI mechanisms. The way you will use it exactly the same as in ASP.NET MVC... There are many articles and tutorials you can search on web for that.&lt;/p&gt;
&lt;p&gt;Happy Coding!&lt;/p&gt;
Hajan</description><pubDate>Sat, 16 Mar 2013 13:22:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/quick-tip-how-to-make-ninject-work-with-asp-net-web-api</guid><category>ASP.NET</category><category>Dependency Injection</category><category>Ninject</category><category>Web Api</category></item><item><title>Speaking at MK Code Camp 2012</title><link>https://weblogs.asp.net:443/hajan/speaking-at-mk-code-camp-2012</link><description>&lt;p&gt;This year same as the previous one, Macedonian .NET User Group is organizing the biggest event for developers and coders, event that is focusing on Microsoft technologies, Macedonian CODE CAMP 2012!&lt;/p&gt;  &lt;p&gt;The Code Camp 2012 will be held at 24th of November at FON University. In the first few hours we have more than 500 registered attendees and the number is increasing rapidly!&lt;/p&gt; &lt;img alt="Code Camp 2012" src="http://codecamp.mkdot.net/themes/codecamp/images/cc12-logo.png" /&gt;   &lt;p&gt;At this year’s Code Camp, I will be speaking on topic “Modern Web Development Principles”, an interesting topic that will focus mainly on updating all the developer with the latest development trends. Here is the whole session description: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“Through lot of code and demonstrations, this presentation aims to update you with the latest web development trends by clearly showing what has changed in web development today comparing with the previous years, what are the newest trends and how you can leverage the Microsoft ASP.NET platform together with all client-side centric development libraries to build the next generation of web apps following the standards and the modern web development principles. This is session for everyone who is involved into Web development in this way or another!”&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Quick links for those who want to learn more about this event:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://codecamp.mkdot.net/page/cc2012-sessions.aspx" target="_blank"&gt;Code Camp 2012 Sessions&lt;/a&gt; (25 Sessions)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://codecamp.mkdot.net/page/cc2012-speakers.aspx" target="_blank"&gt;Code Camp 2012 Speakers&lt;/a&gt; (More than 25 Speakers, 5 Microsoft MVPs, 1 MSFT, Many known Experts)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://mk-codecamp-2012.eventbrite.com/" target="_blank"&gt;Registration Link&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you are somewhere around and interested to join the event, you are welcome!&lt;/p&gt;  &lt;p&gt;Hajan&lt;/p&gt;</description><pubDate>Fri, 16 Nov 2012 20:11:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/speaking-at-mk-code-camp-2012</guid><category>ASP.NET</category><category>code camp</category><category>Community News</category></item><item><title>Emit Knowledge - social network for knowledge sharing</title><link>https://weblogs.asp.net:443/hajan/emit-knowledge</link><description>&lt;div style="margin: 0px; padding: 4px 0px; float: none;" class="wlWriterHeaderFooter"&gt;&lt;iframe src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2012/10/01/emit-knowledge.aspx" style="border: currentColor; width: 450px; height: 80px;" mce_src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2012/10/01/emit-knowledge.aspx" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;
  
&lt;p&gt;&lt;a href="http://www.emitknowledge.com" mce_href="http://www.emitknowledge.com" target="_blank"&gt;Emit Knowledge&lt;/a&gt;, as the words refer - it's a social network for emitting / sharing knowledge from users by users. Those who can benefit the most out of this network is perhaps all of YOU who have something to share with others and contribute to the knowledge world. &lt;/p&gt;
  
&lt;p&gt;&lt;a href="http://www.emitknowledge.com/" title="Emit Knowledge" mce_href="http://www.emitknowledge.com/" rel="tag" target="_blank"&gt;&lt;img src="http://www.emitknowledge.com/Content/assets/logo.png" style="margin: 0px 17px 0px 0px; display: inline; float: left" mce_src="http://www.emitknowledge.com/Content/assets/logo.png" align="left" border="0"&gt;&lt;/a&gt;I've been closely communicating with the core team of this very, very interesting, brand new social network (with specific purpose!) about the concept, idea and the vision they have for their product and I can say with a lot of confidence that this network has real potential to become something from which we will all benefit. I won't speak much about that and would prefer to give you link and try it yourself - &lt;a href="http://www.emitknowledge.com" mce_href="http://www.emitknowledge.com"&gt;http://www.emitknowledge.com&lt;/a&gt;&lt;/p&gt;
  
&lt;p&gt;Mainly, through the past few months I've been testing this network and it is getting improved all the time. The user experience is great, you can easily find out what you need and it follows some known patterns that are common for all social networks. They have some real good ideas and plans that are already under development for the next updates of their product.&lt;/p&gt;
  
&lt;p&gt;You can do micro blogging or you can do regular normal blogging… it’s up to you, and the way it works, it is seamless.&lt;/p&gt;
  
&lt;p&gt;Here is a short QA interview I made with the lead of the team, Marijan Nikolovski:    &lt;br&gt;&lt;/p&gt;
  
&lt;hr&gt;  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;1. Can you please explain us briefly, what is Emit Knowledge?        &lt;br&gt;&lt;/font&gt;&lt;/b&gt;Emit Knowledge is a brand new knowledge based social network, delivering quality content from users to users. &lt;/p&gt;
  
&lt;p&gt;We believe that people’s knowledge, experience and professional thoughts compose quality content, worth sharing among millions around the world. Therefore, we created the platform that matches people’s need to share and gain knowledge in the most suitable and comfortable way. &lt;/p&gt;
  
&lt;p&gt;Easy to work with, Emit Knowledge lets you to smoothly craft and emit knowledge around the globe. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;2. How 'old' is Emit Knowledge?&lt;/font&gt;&lt;/b&gt;     &lt;br&gt;In hamster’s years we are almost five years old start-up :). Just kidding.     &lt;br&gt;We’ve released our public beta about three months ago. Our official release date is 27 of June 2012. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;3. How did you come up with this idea?&lt;/font&gt;&lt;/b&gt;     &lt;br&gt;Everything started from a simple idea to solve a complex problem.     &lt;br&gt;We’ve seen that the social web has become polluted with data and is on the right track to lose its base principles – socialization and common cause. &lt;/p&gt;
  
&lt;p&gt;That was our start point.    &lt;br&gt;We’ve gathered the team, drew some sketches and started to mind map the idea. After several idea refactoring’s Emit Knowledge was born. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;4. Is there any competition out there in the market?&lt;/font&gt;&lt;/b&gt;     &lt;br&gt;Currently we don't have any competitors that share the same cause. &lt;/p&gt;
  
&lt;p&gt;What makes our platform different is the ideology that our product promotes and the functionalities that our platform offers for easy socialization based on interests and knowledge sharing. &lt;/p&gt;
 &lt;iframe src="http://www.youtube.com/embed/V-9ORmY9ryw" mce_src="http://www.youtube.com/embed/V-9ORmY9ryw" allowfullscreen="allowfullscreen" frameborder="0" height="315" width="560"&gt;&lt;/iframe&gt;  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;5. What are the main technologies used to build Emit Knowledge?&lt;/font&gt;&lt;/b&gt;     &lt;br&gt;Emit Knowledge was built on a heterogeneous pallet of technologies. &lt;/p&gt;
  
&lt;p&gt;Currently, we have four of separation:    &lt;br&gt;&lt;/p&gt;
  
&lt;ul&gt;   
&lt;li&gt;UI – Built on ASP.NET MVC3 and Knockout.js; &lt;/li&gt;
    
&lt;li&gt;Messaging infrastructure – Build on top of RabbitMQ; &lt;/li&gt;
    
&lt;li&gt;Background services – Our in-house solution for job distribution, orchestration and processing; &lt;/li&gt;
    
&lt;li&gt;Data storage – Build on top of MongoDB; &lt;/li&gt;
    

 &lt;/ul&gt;
  

  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;6. What are the main reasons for choosing ASP.NET MVC?        &lt;br&gt;&lt;/font&gt;&lt;/b&gt;Since all of our team members are .NET engineers, the decision was very natural. ASP.NET MVC is the only Microsoft web stack that sticks to the HTTP behavioral standards. It is easy to work with, have a tiny learning curve and everyone who is familiar with the HTTP will understand its architecture and convention without any difficulties. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;7. Did you use some of the latest Microsoft technologies? If yes, which ones?        &lt;br&gt;&lt;/font&gt;&lt;/b&gt;Yes, we like to rock the cutting edge tech house. Currently we are using Microsoft’s latest technologies like ASP.NET MVC, Web API (work in progress) and the best for the last; we are utilizing Windows Azure IaaS to the bone. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;8. Can you please tell us shortly, what would be the benefit of regular bloggers in other blogging platforms to join Emit Knowledge?&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;
  
&lt;p&gt;Well, unless you are some of the smoking ace gurus whose blogs are followed by a large number of users, our platform offers knowledge based segregated community equipped with tools that will enable both current and future users to expand their relations and to self-promote in the community based on their activity and knowledge sharing. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;10. I see you are working very intensively and there is already integration with some third-party services to make the process of sharing and emitting knowledge easier, which services did you integrate until now and what do you plan do to next?        &lt;br&gt;&lt;/font&gt;&lt;/b&gt;We have “reemit” functionality for internal sharing and we also support external services like:&lt;/p&gt;
  
&lt;ul&gt;   
&lt;li&gt;Twitter; &lt;/li&gt;
    
&lt;li&gt;LinkedIn; &lt;/li&gt;
    
&lt;li&gt;Facebook; &lt;/li&gt;
 &lt;/ul&gt;
  
&lt;p&gt;For the regular bloggers we have an extra cream, Windows Live Writer support for easy blog posts emitting. &lt;/p&gt;
  
&lt;p&gt;&lt;b&gt;&lt;font color="#4bacc6"&gt;11. What should we expect next?&lt;/font&gt;       &lt;br&gt;&lt;/b&gt;Currently, we are working on a new fancy community feature. This means that we are going to support user groups to be formed. So for all existing communities and user groups out there, wait us a little bit, we are coming for rescue :).&lt;/p&gt;
  
&lt;hr&gt;  
&lt;p&gt;One of the top next features they are developing is the Community Feature. It means, if you have your own User Group, Community Group or any other Group on which you and your users are mostly blogging or sharing (emitting) knowledge in various ways, Emit Knowledge as a platform will help you have everything you need to promote your group, make new followers and host all the necessary stuff that you have had need of.&lt;/p&gt;
  
&lt;p&gt;I would invite you to try the network and start sharing knowledge in a way that will help you gather new followers and spread your knowledge faster, easier and in a more efficient way!&lt;/p&gt;&lt;p&gt;Check my Emit Knowledge Stream &lt;a href="http://www.emitknowledge.com/@hajan" target="_blank" mce_href="http://www.emitknowledge.com/@hajan"&gt;http://www.emitknowledge.com/@hajan&lt;/a&gt; &lt;br&gt;&lt;/p&gt;
  
&lt;p&gt;Let’s &lt;a href="http://www.emitknowledge.com" mce_href="http://www.emitknowledge.com" target="_blank"&gt;Emit Knowledge&lt;/a&gt;!&lt;/p&gt;
</description><pubDate>Mon, 01 Oct 2012 19:00:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/emit-knowledge</guid><category>ASP.NET</category><category>Community News</category><category>emit</category><category>emit knowledge</category><category>knowledge</category></item><item><title>Microsoft MVP 2012 – ASP.NET/IIS</title><link>https://weblogs.asp.net:443/hajan/microsoft-mvp-2012-asp-net-iis</link><description>&lt;p&gt;It’s Sunday. I wasn’t really sure whether I should expect something today or not, although its 1st of July when we all know that the new and re-awarded MVPs should get the ‘Congratulations’ email by Microsoft.&lt;/p&gt;  &lt;p&gt;And YES! I GOT IT! This is my second year, and first time &lt;strong&gt;re-awarded&lt;/strong&gt;…&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Microsoft MVP 2012&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/badges/MVP550x222.png" width="352" height="142" /&gt;&lt;/p&gt;  &lt;p&gt;The feeling is exactly same as the first time… I am honored, privileged, veeeery happy and thankful to Microsoft for this prestigious award!&lt;/p&gt;  &lt;p&gt;The past year was really great with all the events, speaking engagements in various conferences and camps, many other community activities and the first time visit at MVP Global Summit. I am looking forward to boost even more the Microsoft community activities in the next year...&lt;/p&gt;  &lt;p&gt;And… part of the email message:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Dear Hajan Selmani,       &lt;br /&gt;Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in ASP.NET/IIS technical communities during the past year.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I would like to say a big THANK YOU to all stakeholders. First of all, &lt;strong&gt;THANK YOU MICROSOFT&lt;/strong&gt; for this prestigious award, Thanks to CEE &amp;amp; Italy Region MVP Lead, &lt;a href="http://belead.me/about/"&gt;&lt;strong&gt;Alessandro Teglia&lt;/strong&gt;&lt;/a&gt;, who did a great job by helping and supporting MVPs through the whole past year, I hope we will continue collaborating in the same way on the forthcoming year! Thanks to my family, friends, supports, followers, those who read my blogs regularly and have made me reach more than thousands of comments in my ASP.NET Blog :), those who collaborate and work with me on a daily basis and are supporting me in all my community activities. Thank You Everyone!&lt;/p&gt;  &lt;p&gt;There are lot of new, exciting, great and innovative technologies in the Microsoft Technology Stack. I am excited and really looking forward to rock the community in the years to come!&lt;/p&gt;  &lt;p&gt;THANK YOU!&lt;/p&gt;  &lt;p&gt;Hajan&lt;/p&gt;</description><pubDate>Sun, 01 Jul 2012 16:01:06 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/microsoft-mvp-2012-asp-net-iis</guid><category>2012</category><category>ASP.NET</category><category>Microsoft</category><category>MVP</category></item><item><title>Simplify your Ajax code by using jQuery Global Ajax Handlers and ajaxSetup low-level interface</title><link>https://weblogs.asp.net:443/hajan/simplify-your-ajax-code-by-using-jquery-global-ajax-handlers-and-ajaxsetup-low-level-interface</link><description>&lt;p&gt;Creating web applications with consistent layout and user interface is very important for your users. In several ASP.NET projects I’ve completed lately, I’ve been using a lot jQuery and jQuery Ajax to achieve rich user experience and seamless interaction between the client and the server. In almost all of them, I took advantage of the nice jQuery global ajax handlers and jQuery ajax functions.&lt;/p&gt;  &lt;p&gt;Let’s say you build web application which mainly interacts using Ajax post and get to accomplish various operations. As you may already know, you can easily perform Ajax operations using jQuery Ajax low-level method or jQuery $.get, $.post, etc.&lt;/p&gt;  &lt;p&gt;Simple get example:&lt;/p&gt;    &lt;pre class="csharpcode"&gt;$.get(&lt;span class="str"&gt;&amp;quot;/Home/GetData&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt; (d) {
  alert(d);
});&lt;/pre&gt;

&lt;p&gt;As you can see, this is the simplest possible way to make Ajax call. What it does in behind is constructing low-level Ajax call by specifying all necessary information for the request, filling with default information set for the required properties such as data type, content type, etc...&lt;/p&gt;

&lt;p&gt;If you want to have some more control over what is happening with your Ajax Request, you can easily take advantage of the global ajax handlers. In order to register global ajax handlers, jQuery API provides you set of global Ajax methods. You can find all the methods in the following link &lt;a title="http://api.jquery.com/category/ajax/global-ajax-event-handlers/" href="http://api.jquery.com/category/ajax/global-ajax-event-handlers/"&gt;http://api.jquery.com/category/ajax/global-ajax-event-handlers/&lt;/a&gt;, and these are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ajaxComplete&lt;/li&gt;

  &lt;li&gt;ajaxError&lt;/li&gt;

  &lt;li&gt;ajaxSend&lt;/li&gt;

  &lt;li&gt;ajaxStart&lt;/li&gt;

  &lt;li&gt;ajaxStop&lt;/li&gt;

  &lt;li&gt;ajaxSuccess&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the low-level ajax interfaces &lt;a title="http://api.jquery.com/category/ajax/low-level-interface/" href="http://api.jquery.com/category/ajax/low-level-interface/"&gt;http://api.jquery.com/category/ajax/low-level-interface/&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ajax&lt;/li&gt;

  &lt;li&gt;ajaxPrefilter&lt;/li&gt;

  &lt;li&gt;ajaxSetup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For global settings, I usually use ajaxSetup combining it with the ajax event handlers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;$.ajaxSetup&lt;/strong&gt; is very good to help you set default values that you will use in all of your future Ajax Requests, so that you won’t need to repeat the same properties all the time unless you want to override the default settings.&lt;/p&gt;

&lt;p&gt;Mainly, I am using global ajaxSetup function similarly to the following way:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$.ajaxSetup({
    cache: &lt;span class="kwrd"&gt;false&lt;/span&gt;,
    error: function (x, e)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (x.status == 550)
            alert(&lt;span class="str"&gt;&amp;quot;550 Error Message&amp;quot;&lt;/span&gt;);
        &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (x.status == &lt;span class="str"&gt;&amp;quot;403&amp;quot;&lt;/span&gt;)
            alert(&lt;span class="str"&gt;&amp;quot;403. Not Authorized&amp;quot;&lt;/span&gt;);
        &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (x.status == &lt;span class="str"&gt;&amp;quot;500&amp;quot;&lt;/span&gt;)
            alert(&lt;span class="str"&gt;&amp;quot;500. Internal Server Error&amp;quot;&lt;/span&gt;);
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
            alert(&lt;span class="str"&gt;&amp;quot;Error...&amp;quot;&lt;/span&gt;);
    },
    success: function (x)
    {
        &lt;span class="rem"&gt;//do something global on success... &lt;/span&gt;
    }

});&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now, you can make ajax call using low-level $.ajax interface and you don’t need to worry about specifying any of the properties we’ve set in the $.ajaxSetup function.&lt;/p&gt;

&lt;p&gt;So, you can create your own ways to handle various situations when your Ajax requests are occurring.&lt;/p&gt;

&lt;p&gt;Sometimes, some of your Ajax Requests may take much longer than expected… So, in order to make user friendly UI that will show some progress bar or animated image that something is happening in behind, you can combine ajaxStart and ajaxStop methods to do the same.&lt;/p&gt;

&lt;p&gt;First of all, add one &amp;lt;div id=”loading” style=”display:none;”&amp;gt; &amp;lt;img src=&amp;quot;@Url.Content(&amp;quot;~/Content/images/ajax-loader.gif&amp;quot;)&amp;quot; alt=&amp;quot;Ajax Loader&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt; anywhere on your Master Layout / Master page (you can download nice ajax loading images from &lt;a title="http://ajaxload.info/" href="http://ajaxload.info/"&gt;http://ajaxload.info/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Then, add the following two handlers:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$(document).ajaxStart(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {
    $(&lt;span class="str"&gt;&amp;quot;#loading&amp;quot;&lt;/span&gt;).attr(&lt;span class="str"&gt;&amp;quot;style&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;position:absolute; z-index: 1000; top: 0px; &amp;quot;&lt;/span&gt;+
        &lt;span class="str"&gt;&amp;quot;left:0px; text-align: center; display:none; background-color: #ddd; &amp;quot;&lt;/span&gt;+
        &lt;span class="str"&gt;&amp;quot;height: 100%; width: 100%; /* These three lines are for transparency &amp;quot;&lt;/span&gt;+
        &lt;span class="str"&gt;&amp;quot;in all browsers. */-ms-filter:\&amp;quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=50)\&amp;quot;;&amp;quot;&lt;/span&gt;+
        &lt;span class="str"&gt;&amp;quot; filter: alpha(opacity=50); opacity:.5;&amp;quot;&lt;/span&gt;);
    $(&lt;span class="str"&gt;&amp;quot;#loading img&amp;quot;&lt;/span&gt;).attr(&lt;span class="str"&gt;&amp;quot;style&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;position:relative; top:40%; z-index:5;&amp;quot;&lt;/span&gt;);
    $(&lt;span class="str"&gt;&amp;quot;#loading&amp;quot;&lt;/span&gt;).show();
});

$(document).ajaxStop(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {
    $(&lt;span class="str"&gt;&amp;quot;#loading&amp;quot;&lt;/span&gt;).removeAttr(&lt;span class="str"&gt;&amp;quot;style&amp;quot;&lt;/span&gt;);
    $(&lt;span class="str"&gt;&amp;quot;#loading img&amp;quot;&lt;/span&gt;).removeAttr(&lt;span class="str"&gt;&amp;quot;style&amp;quot;&lt;/span&gt;);
    $(&lt;span class="str"&gt;&amp;quot;#loading&amp;quot;&lt;/span&gt;).hide();
});&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;em&gt;Note: While you can reorganize the style in a more reusable way, since these are global Ajax Start/Stop, it is very possible that you won’t use the same style in other places.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With this way, you will see that now for any ajax request in your web site or application, you will have the loading image appearing providing better user experience.&lt;/p&gt;

&lt;p&gt;What I’ve shown is several useful examples on how to simplify your Ajax code by using Global Ajax Handlers and the low-level AjaxSetup function. Of course, you can do a lot more with the other methods as well.&lt;/p&gt;

&lt;p&gt;Hope this was helpful.&lt;/p&gt;

&lt;p&gt;Regards,
  &lt;br /&gt;Hajan&lt;/p&gt;</description><pubDate>Mon, 18 Jun 2012 02:34:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/simplify-your-ajax-code-by-using-jquery-global-ajax-handlers-and-ajaxsetup-low-level-interface</guid><category>AJAX</category><category>ajaxSetup</category><category>ajaxStart</category><category>ajaxStop</category><category>Global</category><category>Handlers</category><category>jQuery</category></item><item><title>Now officially MSc. in Computer Sciences</title><link>https://weblogs.asp.net:443/hajan/now-officially-msc-in-computer-sciences</link><description>&lt;p&gt;After having a long journey into deep research and analysis of Performance Evaluation Systems with specific focus to academic institutions, I have successfully completed and defended my Master Thesis title in Computer Sciences at South-East European University in Tetovo, Macedonia.&lt;/p&gt;  &lt;p&gt;My master thesis was compound of theoretical deep research into the field and practical implementation of real-world application that helps in automating processes in performance evaluation of academic staff.&lt;/p&gt;  &lt;p&gt;The practical implementation of the project is a web-based application built on top of &lt;u&gt;Microsoft latest technologies&lt;/u&gt;.&lt;/p&gt;</description><pubDate>Fri, 09 Mar 2012 19:03:47 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/now-officially-msc-in-computer-sciences</guid><category>.NET 4.0</category><category>master</category><category>Microsoft</category><category>science</category></item><item><title>Sending emails using MvcMailer</title><link>https://weblogs.asp.net:443/hajan/sending-emails-using-mvcmailer</link><description>&lt;div style="margin: 0px; padding: 4px 0px; float: none;" class="wlWriterHeaderFooter"&gt;&lt;iframe style="border: currentColor; width: 450px; height: 80px;" src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2012/01/15/sending-emails-using-mvcmailer.aspx" frameBorder="0" scrolling="no" mce_src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2012/01/15/sending-emails-using-mvcmailer.aspx"&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p&gt;MvcMailer is an interesting component that you can use for sending emails in ASP.NET MVC Framework. The very great thing is that it uses Razor view engine views as email templates and is pretty easy to setup and use. In this article you will see how to install it, setup email templates and send emails…&lt;/p&gt;
  
&lt;p&gt;&lt;strong&gt;1. INSTALLATION&lt;/strong&gt;&lt;/p&gt;
  
&lt;p&gt;- First of all, create new ASP.NET MVC project (or use one you are already developing…)&lt;/p&gt;
  
&lt;p&gt;- The next thing is to install the component. The component can be installed using NuGet Package Manager (PowerShell console or NuGet Packages Dialog) or you can get the source code directly from the Github repository &lt;a href="https://github.com/smsohan/MvcMailer" target="_blank" mce_href="https://github.com/smsohan/MvcMailer"&gt;here&lt;/a&gt;.&lt;/p&gt;
  
&lt;p&gt;&lt;strong&gt;Installing using NuGet Package Manager&lt;/strong&gt;&lt;/p&gt;
  
&lt;p&gt;If you want to install it using NuGet Packages Manager Dialog, you can find it on Visual Studio.NET 2010 in Tools –&amp;gt; Library Package Manager –&amp;gt; Manage NuGet Packages…&lt;/p&gt;
  
&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/05_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/05_aspnetmvc_mvcmailer.png"&gt;&lt;/p&gt;
  
&lt;p&gt;and then search for &lt;strong&gt;MvcMailer&lt;/strong&gt;&lt;/p&gt;
  
&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/06_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/06_aspnetmvc_mvcmailer.png"&gt;&lt;/p&gt;
  
&lt;p&gt;By clicking &lt;strong&gt;Install&lt;/strong&gt;, the NuGet will do all the job for you.&lt;/p&gt;
  
&lt;p&gt;On the other hand (as I always prefer to do), if you use NuGet PowerShell Console, just run the following command:&lt;/p&gt;
  
&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/04_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/04_aspnetmvc_mvcmailer.png"&gt;&lt;/p&gt;
  
&lt;p&gt;Once you run the command, following log in the console has been generated in my side:&lt;/p&gt;
  
&lt;blockquote&gt;   &lt;div id="codeSnippetWrapper" class="csharpcode-wrapper"&gt;     
&lt;pre id="codeSnippet" class="csharpcode"&gt;PM&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; Install-Package MvcMailer&lt;br&gt;Attempting to resolve dependency 'T4Scaffolding (≥ 0.9.7)'.&lt;br&gt;Attempting to resolve dependency 'EntityFramework (≥ 4.1.10311.0)'.&lt;br&gt;You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=224682. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.&lt;br&gt;Successfully installed 'EntityFramework 4.1.10715.0'.&lt;br&gt;Successfully installed 'T4Scaffolding 0.9.9'.&lt;br&gt;Successfully installed 'MvcMailer 1.1'.&lt;br&gt;Successfully removed 'EntityFramework 4.1.10331.0' from MyMvcMailer.&lt;br&gt;Successfully added 'EntityFramework 4.1.10715.0' to MyMvcMailer.&lt;br&gt;Successfully added 'T4Scaffolding 0.9.9' to MyMvcMailer.&lt;br&gt;Successfully added 'MvcMailer 1.1' to MyMvcMailer.&lt;/pre&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;NuGet will add MvcMailer.dll to your solution and you are done with installation.&lt;/p&gt;


&lt;p id="cr"&gt;&lt;strong&gt;2. SETUP EMAIL SETTINGS &amp;amp; EMAIL TEMPLATES&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;- Setup Email Settings&lt;/p&gt;

&lt;p&gt;General practice in ASP.NET is to setup your email settings in Web.Config. Once you’ve installed MvcMailer, if you open web.config you will see it already have setup default mail settings… &lt;/p&gt;

&lt;pre class="code"&gt;    &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;system.net&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;mailSettings&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
            &amp;lt;!-- &lt;/span&gt;&lt;span style="color: green;"&gt;Method#1: Configure smtp server credentials &lt;/span&gt;&lt;span style="color: blue;"&gt;--&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;smtp &lt;/span&gt;&lt;span style="color: red;"&gt;from&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;some-email@gmail.com&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;network &lt;/span&gt;&lt;span style="color: red;"&gt;enableSsl&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;" &lt;span style="color: red;"&gt;host&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;smtp.gmail.com&lt;/span&gt;" &lt;span style="color: red;"&gt;port&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;587&lt;/span&gt;" &lt;span style="color: red;"&gt;userName&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;some-email@gmail.com&lt;/span&gt;" &lt;span style="color: red;"&gt;password&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;valid-password&lt;/span&gt;" &lt;span style="color: blue;"&gt;/&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;smtp&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
            &amp;lt;!-- &lt;/span&gt;&lt;span style="color: green;"&gt;Method#2: Dump emails to a local directory &lt;/span&gt;&lt;span style="color: blue;"&gt;--&amp;gt;
            &amp;lt;!--
            &lt;/span&gt;&lt;span style="color: green;"&gt;&amp;lt;smtp from="some-email@gmail.com" deliveryMethod="SpecifiedPickupDirectory"&amp;gt;
                &amp;lt;network host="localhost" /&amp;gt;
                &amp;lt;specifiedPickupDirectory pickupDirectoryLocation="c:\temp\"/&amp;gt;
            &amp;lt;/smtp&amp;gt;
            &lt;/span&gt;&lt;span style="color: blue;"&gt;--&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;mailSettings&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;system.net&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Replace your SMTP settings&amp;nbsp; and you are done.&lt;/p&gt;

&lt;p&gt;- Setup Default Email Templates&lt;/p&gt;

&lt;p&gt;Open NuGet Console and run the following command:&lt;/p&gt;

&lt;pre&gt;&lt;div id="codeSnippetWrapper" class="csharpcode-wrapper"&gt;
&lt;pre id="codeSnippet" class="csharpcode"&gt;PM&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; Scaffold Mailer UserMailer Welcome,GoodBye&lt;/pre&gt;&lt;/div&gt;&lt;font face="Calibri"&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;font face="Calibri"&gt;After running this command, default email templates will be installed in your project. The log should be as follows:&lt;/font&gt;&lt;/pre&gt;

&lt;pre&gt;Added MvcMailer output 'Mailers\IUserMailer.cs'
Added MvcMailer output 'Mailers\UserMailer.cs'
Added MyScaffolder output 'Views\UserMailer\_Layout.cshtml'
Added MyScaffolder output 'Views\UserMailer\Welcome.cshtml'
Added MyScaffolder output 'Views\UserMailer\GoodBye.cshtml'&lt;/pre&gt;

&lt;pre&gt;&lt;font face="Calibri"&gt;Expand Views –&amp;gt; UserMailer and you will see the following:&lt;/font&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/07_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/07_aspnetmvc_mvcmailer.png"&gt;&lt;/pre&gt;

&lt;p&gt;Then expand Mailers folder where you have IUserMailer interface and UserMailer class with implementation for Welcome and GoodBye mail templates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;
    &lt;br&gt;3. SEND EMAILS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To send email, simply create new Controller (name it whatever you like) and create view for that controller.&lt;/p&gt;

&lt;p&gt;Example
  &lt;br&gt; Controller: HomeController (add ActionResult Index)
  &lt;br&gt; View: Home/Index&lt;/p&gt;

&lt;p&gt;To send email, use the following code:
  
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;ActionResult &lt;/span&gt;Index()
{
    &lt;span style="color: rgb(43, 145, 175);"&gt;IUserMailer &lt;/span&gt;mailer = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;UserMailer&lt;/span&gt;();
    mailer.Welcome().Send();
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;View();
}&lt;/pre&gt;

&lt;p&gt;or even better implementation would be: 
  
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IUserMailer &lt;/span&gt;_mailer = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;UserMailer&lt;/span&gt;();
&lt;span style="color: blue;"&gt;public &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IUserMailer &lt;/span&gt;Mailer
{
    &lt;span style="color: blue;"&gt;get &lt;/span&gt;{ &lt;span style="color: blue;"&gt;return &lt;/span&gt;_mailer; }
    &lt;span style="color: blue;"&gt;set &lt;/span&gt;{ _mailer = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }
}
&lt;span style="color: blue;"&gt;public &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;ActionResult &lt;/span&gt;Index()
{
    Mailer.Welcome().Send();
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;View();
}&lt;/pre&gt;
  

&lt;p&gt;You will need to include: 
  
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;using &lt;/span&gt;Mvc.Mailer;&lt;/pre&gt;
  and directive to your ProjectName.Mailers where UserMailer class is implemented.

&lt;p&gt;Open UserMailer.cs and change the Welcome() method code to this:
  
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public virtual &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MailMessage &lt;/span&gt;Welcome()
{
    &lt;span style="color: blue;"&gt;var &lt;/span&gt;mailMessage = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;MailMessage &lt;/span&gt;{ Subject = &lt;span style="color: rgb(163, 21, 21);"&gt;"Welcome" &lt;/span&gt;};
    
    mailMessage.To.Add(&lt;span style="color: rgb(163, 21, 21);"&gt;"hajan@hajan.com"&lt;/span&gt;);
    ViewBag.Name = &lt;span style="color: rgb(163, 21, 21);"&gt;"Hajan"&lt;/span&gt;;            
    PopulateBody(mailMessage, viewName: &lt;span style="color: rgb(163, 21, 21);"&gt;"Welcome"&lt;/span&gt;);
    &lt;span style="color: blue;"&gt;return &lt;/span&gt;mailMessage;
}&lt;/pre&gt;
  

&lt;p&gt;&lt;strong&gt;4. PASS DATA TO EMAIL TEMPLATE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can pass data to email template using ViewBag, ViewData, TempData or strongly typed Model.
  &lt;br&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. USE MASTER LAYOUT AND ABSOLUTE URL FOR IMAGES&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since your email templates are Razor views, you can easily use _Layout.cshtml as master layout.&lt;/p&gt;

&lt;p&gt;For example, your _Layout.cshtml could be something like this:
  
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;html&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;style &lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;="text/css"&amp;gt;
            &lt;/span&gt;&lt;span style="color: maroon;"&gt;div &lt;/span&gt;{ &lt;span style="color: red;"&gt;font-family&lt;/span&gt;:&lt;span style="color: blue;"&gt;Verdana, Arial, Sans-Serif&lt;/span&gt;; &lt;span style="color: red;"&gt;font-size&lt;/span&gt;:&lt;span style="color: blue;"&gt;10px&lt;/span&gt;; }
            &lt;span style="color: maroon;"&gt;#mail-message &lt;/span&gt;{ &lt;span style="color: red;"&gt;padding&lt;/span&gt;:&lt;span style="color: blue;"&gt;10px&lt;/span&gt;; }
            &lt;span style="color: maroon;"&gt;#mail-footer &lt;/span&gt;{ &lt;span style="color: red;"&gt;padding&lt;/span&gt;:&lt;span style="color: blue;"&gt;10px&lt;/span&gt;; }
        &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;style&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;head&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;div &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="mail-message"&amp;gt;
        &lt;/span&gt;&lt;span style="background: yellow;"&gt;@&lt;/span&gt;RenderBody()
    &lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;div&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;div &lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;="mail-footer"&amp;gt;
        &lt;/span&gt;Best Regards,&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;a &lt;/span&gt;&lt;span style="color: red;"&gt;href&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://www.mywebsite.com"&amp;gt;&lt;/span&gt;www.mywebsite.com&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;a&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;div&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;body&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;html&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
  

&lt;p&gt;Welcome.cshtml:
  
&lt;pre class="code"&gt;Welcome &lt;span style="background: yellow;"&gt;@&lt;/span&gt;ViewBag.Name
&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;br &lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;
&lt;/span&gt;Thank you for joining our website...&lt;/pre&gt;
  

&lt;p&gt;The email sent looks like this:&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/09_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/09_aspnetmvc_mvcmailer.png"&gt;&lt;/p&gt;

&lt;p&gt;If you want to add links or images to your email, you have to use Absolute URL to your images… For that purpose, MvcMailer have Abs extension method.&lt;/p&gt;

&lt;p&gt;Welcome.cshtml view with image
  &lt;br&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/10_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/10_aspnetmvc_mvcmailer.png"&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. TEST EMAILS WITH WRITING OUT TO TEMP FOLDER&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you don’t want to setup SMTP, you can easily switch to write emails out to &lt;strong&gt;C:\temp&lt;/strong&gt; folder by commenting the SMTP block in web.config and use the Method#2
  
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;smtp &lt;/span&gt;&lt;span style="color: red;"&gt;from&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;admin@mywebsite.com&lt;/span&gt;" &lt;span style="color: red;"&gt;deliveryMethod&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;SpecifiedPickupDirectory&lt;/span&gt;"&lt;span style="color: blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;network &lt;/span&gt;&lt;span style="color: red;"&gt;host&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;localhost&lt;/span&gt;" &lt;span style="color: blue;"&gt;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;specifiedPickupDirectory &lt;/span&gt;&lt;span style="color: red;"&gt;pickupDirectoryLocation&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;c:\temp\&lt;/span&gt;"&lt;span style="color: blue;"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;smtp&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;
  
&lt;pre class="code"&gt;&lt;font face="Calibri"&gt;Try to send email and open the C:\Temp folder.&lt;/font&gt;&lt;/pre&gt;
  
&lt;pre class="code"&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/08_aspnetmvc_mvcmailer.png" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2012/MvcMailer/08_aspnetmvc_mvcmailer.png"&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. BONUS STUFF…&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can see that MvcMailer is very good component that can help you sending emails on an very easy way by using razor (or any other view engine) views as email templates. We have generated &lt;u&gt;Welcome&lt;/u&gt; and &lt;u&gt;GoodBye&lt;/u&gt; views, but you can also generate other mailers as well, using the following command (example):&lt;/p&gt;

&lt;p&gt;Scaffold Mailer NotficationMailer FriendRequest, FriendsMessage, Follow, Liked&lt;/p&gt;

&lt;div id="codeSnippetWrapper" class="csharpcode-wrapper"&gt;
  
&lt;pre id="codeSnippet" class="csharpcode"&gt;PM&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; Scaffold Mailer NotficationMailer FriendRequest, FriendsMessage, Follow, Liked&lt;br&gt;Added MvcMailer output 'Mailers\INotficationMailer.cs'&lt;br&gt;Added MvcMailer output 'Mailers\NotficationMailer.cs'&lt;br&gt;Added MyScaffolder output 'Views\NotficationMailer\_Layout.cshtml'&lt;br&gt;Added MyScaffolder output 'Views\NotficationMailer\FriendRequest.cshtml'&lt;br&gt;Added MyScaffolder output 'Views\NotficationMailer\FriendsMessage.cshtml'&lt;br&gt;Added MyScaffolder output 'Views\NotficationMailer\Follow.cshtml'&lt;br&gt;Added MyScaffolder output 'Views\NotficationMailer\Liked.cshtml'&lt;/pre&gt;
  &lt;br&gt;&lt;/div&gt;


&lt;p&gt;MvcMailer gives you very clean and easy way for having mail sender feature in your ASP.NET MVC web applications. By using Views as templates, you can use the powerful Razor to easily create, update and maintain your email templates.&lt;/p&gt;

&lt;p&gt;
  &lt;br&gt;Hope this was useful and helpful post.&lt;/p&gt;

&lt;p&gt;Regards,
  &lt;br&gt;Hajan&lt;/p&gt;
</description><pubDate>Sun, 15 Jan 2012 16:35:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/sending-emails-using-mvcmailer</guid><category>ASP.NET</category><category>ASP.NET MVC</category><category>MvcMailer</category><category>NuGet</category><category>Razor</category><category>Sending Emails</category></item><item><title>Guest Speaker at Universities around Macedonia</title><link>https://weblogs.asp.net:443/hajan/guest-speaker-at-universities-in-macedonia</link><description>&lt;div style="margin: 0px; padding: 4px 0px; float: none;" class="wlWriterHeaderFooter"&gt;&lt;iframe style="border: currentColor; width: 450px; height: 80px;" src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/12/18/guest-speaker-at-universities-in-macedonia.aspx" frameBorder="0" scrolling="no" mce_src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/12/18/guest-speaker-at-universities-in-macedonia.aspx"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Previous and the next week I am a guest speaker at few Computer and Information Science faculties, at different Universities around Macedonia.&lt;/p&gt;  &lt;p&gt;   &lt;br&gt;&lt;strong&gt;Previous week I have had great time speaking at:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Tuesday, 13 December 2011 - &lt;a href="http://seeu.edu.mk/en/faculties/cst" target="_blank" mce_href="http://seeu.edu.mk/en/faculties/cst"&gt;CST Faculty&lt;/a&gt;, &lt;a href="http://www.seeu.edu.mk" target="_blank" mce_href="http://www.seeu.edu.mk"&gt;South-East European University&lt;/a&gt; in Tetovo, speaking on topic “Web Development – Today” having general talk about where we are with web development today and presenting Microsoft’s technologies and platforms such as: ASP.NET Web Pages, WebMatrix, ASP.NET Web Forms, ASP.NET MVC, Visual Studio.NET 2010, etc.&lt;/p&gt;  &lt;p&gt;Wednesday, 14 December 2011 - &lt;a href="http://www.uist.edu.mk/" target="_blank" mce_href="http://www.uist.edu.mk/"&gt;University for Information Science and Technology “St. Paul the Apostle”&lt;/a&gt; in Ohrid, speaking on topic “ASP.NET MVC” where I have been speaking about MVC pattern, ASP.NET MVC Platform and many flavors that this great platform offers to web developers.&lt;/p&gt;  &lt;p&gt;   &lt;br&gt;&lt;strong&gt;Next week (from tomorrow and on), I am a guest speaker at:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Monday, 19 December 2011 - &lt;a href="http://www.finki.ukim.mk/en/home" target="_blank" mce_href="http://www.finki.ukim.mk/en/home"&gt;Faculty of Computer Science and Engineering (aka FINKI)&lt;/a&gt; at &lt;a href="http://www.ukim.edu.mk/" target="_blank" mce_href="http://www.ukim.edu.mk/"&gt;Ss. Cyril and Methodius University&lt;/a&gt; in Skopje, will be speaking on topic “Advanced Web Programming with Microsoft ASP.NET” where I will show students what platforms and tools are available for building great web apps with main focus on ASP.NET MVC Framework.&lt;/p&gt;  &lt;p&gt;Wednesday, 21 December 2011 - &lt;a href="http://seeu.edu.mk/en/faculties/cst" target="_blank" mce_href="http://seeu.edu.mk/en/faculties/cst"&gt;CST Faculty&lt;/a&gt;, &lt;a href="http://www.seeu.edu.mk" target="_blank" mce_href="http://www.seeu.edu.mk"&gt;South-East European University&lt;/a&gt; in Skopje, will be speaking on the same topic I did at this faculty in city Tetovo.&lt;/p&gt;  &lt;p&gt;   &lt;br&gt;For me, this is a great way to finish 2011 year. &lt;/p&gt;  &lt;p&gt;Blog post summary for 2011 year will follow within the next two weeks.&lt;/p&gt;  &lt;p&gt;Regards,   &lt;br&gt;Hajan&lt;/p&gt;</description><pubDate>Sun, 18 Dec 2011 11:58:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/guest-speaker-at-universities-in-macedonia</guid><category>ASP.NET</category><category>ASP.NET MVC</category><category>ASP.NET WebPages</category><category>Community News</category><category>CST</category><category>Faculty</category><category>Speaking</category><category>University</category><category>WebMatrix</category></item><item><title>Code Camp 2011 – Summary</title><link>https://weblogs.asp.net:443/hajan/code-camp-2011-summary</link><description>&lt;div style="margin: 0px; padding: 4px 0px; float: none;" class="wlWriterHeaderFooter"&gt;&lt;iframe style="border: currentColor; width: 450px; height: 80px;" src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/11/28/code-camp-2011-summary.aspx" frameBorder="0" scrolling="no" mce_src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/11/28/code-camp-2011-summary.aspx"&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p&gt;Waiting whole twelve months to come this year’s &lt;a href="http://codecamp.mkdot.net/" target="_blank" mce_href="http://codecamp.mkdot.net/"&gt;Code Camp 2011&lt;/a&gt; event was something which all Microsoft technologies (and even non-Microsoft techs.) developers were doing in the past year. Last year’s success was enough big to be heard and to influence everything around our developer community and beyond. &lt;/p&gt;  &lt;p&gt;&lt;img style="width: 600px; height: 100px;" src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/codecamp2011_summary/cc11-logo-pet-boi.png" width="600" height="100" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/codecamp2011_summary/cc11-logo-pet-boi.png"&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://codecamp.mkdot.net/" target="_blank" mce_href="http://codecamp.mkdot.net/"&gt;Code Camp 2011&lt;/a&gt; was nothing else but a invincible success which will remain in our memory for a long time from now. &lt;a href="http://mkdot.net/blogs/darko/" target="_blank" mce_href="http://mkdot.net/blogs/darko/"&gt;Darko Milevski&lt;/a&gt; (president of MKDOT.NET UG and SharePoint MVP) said something interesting at the event &lt;u&gt;keynote&lt;/u&gt; that up to now we were looking at the past by saying what we did… now we will focus on the future and how to develop our community more and more in the future days, weeks, months and I hope so for many years…&lt;/p&gt;  &lt;p&gt;Even though it was held only two days ago (26th of November 2011), I already feel the nostalgia for everything that happened there and for the excellent time we have spent all together.   &lt;br&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;ORGANIZED BY ENTHUSIASTS AND EXPERTS     &lt;br&gt;&lt;/strong&gt;&lt;a href="http://codecamp.mkdot.net" target="_blank" mce_href="http://codecamp.mkdot.net"&gt;Code Camp 2011&lt;/a&gt; was organized by number of community enthusiasts and experts who have unselfishly contributed with all their free time to make the best of this event. The event was organized by a known community group called &lt;a href="http://mkdot.net" target="_blank" mce_href="http://mkdot.net"&gt;&lt;strong&gt;MKDOT.NET User Group&lt;/strong&gt;&lt;/a&gt;, name of a user group which is known not only in Macedonia, but also in many countries abroad.&lt;/p&gt;  &lt;p&gt;Organization mainly consists of software developers, technical leaders, team leaders in several known companies in Macedonia, as well as Microsoft MVPs.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SPEAKERS     &lt;br&gt;&lt;/strong&gt;There were &lt;a href="http://codecamp.mkdot.net/page/cc2011-speakers.aspx" target="_blank" mce_href="http://codecamp.mkdot.net/page/cc2011-speakers.aspx"&gt;24 speakers&lt;/a&gt; at &lt;a href="http://codecamp.mkdot.net/agenda.aspx" target="_blank" mce_href="http://codecamp.mkdot.net/agenda.aspx"&gt;five parallel tracks&lt;/a&gt;. At Code Camp 2011 we had two groups of speakers: &lt;u&gt;Professional Experts in various technologies&lt;/u&gt; and &lt;u&gt;Student Speakers&lt;/u&gt;. The new interesting thing here is the Student Speakers, which draw attention a lot, especially to other students who were interested to see what their colleagues are going to speak about and how do they use Microsoft technologies in different coding scenarios and practices, in different topics.&lt;/p&gt;  &lt;p&gt;From the rest of the professional speakers, there were 7 Microsoft MVPs: Two ASP.NET/IIS MVPs, Two C# MVPs, and One MVP in SharePoint, SQL Server and Exchange Server.&lt;/p&gt;  &lt;p&gt;I must say that besides the MVP Speakers, who definitely did a great job as always… there were other excellent speakers as well, which were speaking on various technologies, such as: Web Development, Windows Phone Development, XNA, Windows 8, Games Development, Entity Framework, Event-driven programming, SOLID, SQLCLR, T-SQL, e.t.c.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SESSIONS     &lt;br&gt;&lt;/strong&gt;There were &lt;a href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx" target="_blank" mce_href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx"&gt;25 sessions&lt;/a&gt; mainly all related to Microsoft technologies, but ranging from Windows 8, WP7, ASP.NET till Games Development, XNA and Event-driven programming.&lt;/p&gt;  &lt;p&gt;Sessions were going in &lt;a href="http://codecamp.mkdot.net/agenda.aspx" target="_blank" mce_href="http://codecamp.mkdot.net/agenda.aspx"&gt;five parallel tracks&lt;/a&gt; named as Red, Yellow, Green, Blue and Student track. Five presentations in each track, each with level 300 or 400.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx" target="_blank" mce_href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx"&gt;More info&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;img style="width: 642px; height: 651px;" src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/codecamp2011_summary/bluzon-back-print-01.jpg" width="642" height="651" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/codecamp2011_summary/bluzon-back-print-01.jpg"&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;MY SESSION (ASP.NET MVC Best Practices)     &lt;br&gt;&lt;/strong&gt;I must say that from the big number of speaking engagements I have had, this was one of my best performances and definitely I have set new records of attendees at my sessions and probably overall.&lt;/p&gt;  &lt;p&gt;I spoke on topic &lt;strong&gt;&lt;a href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx#session.2.3" target="_blank" mce_href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx#session.2.3"&gt;ASP.NET MVC Best Practices&lt;/a&gt;&lt;/strong&gt;, where I have shown tips, tricks, guidelines and best practices on what to use and what to avoid by developing with one of the best web development frameworks nowadays, &lt;a href="http://www.asp.net/mvc" target="_blank" mce_href="http://www.asp.net/mvc"&gt;ASP.NET MVC&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I had approximately 350+ attendees, the hall was full so that there was no room for staying at feet. Besides .NET developers, there were a lot of other technology oriented developers, who has also received the presentation very well and I really hope I gave them reason to think about ASP.NET as one of the best options for web development nowadays (if you ask me, it’s the best one ;-)).&lt;/p&gt;  &lt;p&gt;I have included 10 tips in using ASP.NET MVC each of them followed by a demo. Besides these 10 tips, I have briefly introduced the concept of ASP.NET MVC for those that haven’t been working with the framework and at the end some bonus tips. I must say there was lot of laugh for some funny sentences I have stated, like “If you code ASP.NET MVC, girls will love you more” – same goes for girls, only replace girls with boys :).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=1187&amp;amp;postid=8078025#" target="_blank" mce_href="http://weblogs.asp.net/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=1187&amp;amp;postid=8078025#"&gt;[LINK TO SESSION WILL GO HERE, ONCE SESSIONS ARE AVAILABLE ON MK CODECAMP WEBSITE]&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;VOLUNTEERS     &lt;br&gt;&lt;/strong&gt;Without strong organization, such events wouldn’t be able to gather hundreds of attendees at one place and still stay perfectly organized to the smallest details, without dedicated organization and volunteers. I would like to dedicate this space in my blog to them and to say one big THANK YOU for supporting us before the event and during the whole day in the event. With such young and dedicated volunteers, we couldn’t achieve anything but great results. THANK YOU EVERYONE FOR YOUR CONTRIBUTION!&lt;/p&gt;&lt;p&gt;&lt;img style="width: 700px; height: 235px;" src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/codecamp2011_summary/mail-najavna-slika.jpg" width="700" height="235" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/codecamp2011_summary/mail-najavna-slika.jpg"&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;NETWORKING     &lt;br&gt;&lt;/strong&gt;One of the main reasons why we do such events is to gather all professionals in one place. Networking is what everyone wants because through this way of networking, we can meet incredible people in one place. It is amazing feeling to share your knowledge with others and exchange thoughts on various topics. Meet and talk to interesting people. I have had very special moments with many attendees especially after my presentation. Special &lt;u&gt;Thank You&lt;/u&gt; to all of them who come to meet me in person, whether to ask a question, say congrats for my session or simply meet me and just smile :)… everything counts! Thank You!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;TWITTER     &lt;br&gt;&lt;/strong&gt;During the event, twitter was one of the most useful event-wide communication tool where everyone could tweet with hash tag #mkcodecamp or #mkdotnet and say what he/she wants to say about the current state and happenings at that moment… In my next blog post I will list the top craziest tweets that were posted at this event… &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;FUTURE OF MKDOT.NET     &lt;br&gt;&lt;/strong&gt;Having such strong community around MKDOT.NET, the future seems very bright. The initial plans are to have sub-groups in several technologies, however all these sub-groups will belong to the MKDOT.NET UG which will be, somehow, the HEAD of these sub-groups. We are doing this to provide better divisions by technologies and organize ourselves better since our community is very big, around 500 members in MKDOT.NET.&lt;/p&gt;&lt;p&gt;We will have five sub-groups:&lt;br&gt;- Web User Group (Lead:Hajan Selmani&amp;nbsp;- &lt;strong&gt;me&lt;/strong&gt;)&lt;br&gt;- Mobile User Group (Lead: Filip Kerazovski)&lt;br&gt;- Visual C# User Group (Lead: Vekoslav Stefanovski)&lt;br&gt;- SharePoint User Group (Lead: Darko Milevski)&lt;br&gt;- Dynamics User Group (Lead: Vladimir Senih)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SUMMARY     &lt;br&gt;&lt;/strong&gt;Online registered attendees: &lt;strong&gt;~1.200     &lt;br&gt;&lt;/strong&gt;Event attendees: &lt;strong&gt;~800     &lt;br&gt;&lt;/strong&gt;Number of members in organization: &lt;strong&gt;40+     &lt;br&gt;&lt;/strong&gt;Organized by: &lt;strong&gt;MKDOT.NET User Group&lt;/strong&gt;    &lt;br&gt;Number of tracks: &lt;strong&gt;5&lt;/strong&gt;    &lt;br&gt;Number of speakers: &lt;strong&gt;24&lt;/strong&gt;    &lt;br&gt;Number of sessions: &lt;strong&gt;25&lt;/strong&gt;    &lt;br&gt;Event official website: &lt;a href="http://codecamp.mkdot.net" mce_href="http://codecamp.mkdot.net"&gt;http://codecamp.mkdot.net&lt;/a&gt;    &lt;br&gt;Total number of sponsors: &lt;strong&gt;20&lt;/strong&gt;    &lt;br&gt;Platinum Sponsors: &lt;strong&gt;Microsoft, INETA, Telerik&lt;/strong&gt;    &lt;br&gt;Place held: &lt;strong&gt;FON University&lt;/strong&gt;    &lt;br&gt;City and Country: &lt;strong&gt;Skopje, Macedonia&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;THANK YOU FOR BEING PART OF THE BEST EVENT IN MACEDONIA, CODE CAMP 2011.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Regards,   &lt;br&gt;Hajan&lt;/p&gt;</description><pubDate>Mon, 28 Nov 2011 20:10:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/code-camp-2011-summary</guid><category>ASP.NET MVC</category><category>code camp</category><category>Community News</category><category>Macedonian CodeCamp</category><category>Speaking</category></item><item><title>Macedonian Code Camp 2011</title><link>https://weblogs.asp.net:443/hajan/macedonian-code-camp-2011</link><description>&lt;div class="wlWriterHeaderFooter" style="float:none; margin:0px; padding:4px 0px 4px 0px;"&gt;&lt;iframe src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/11/22/macedonian-code-camp-2011.aspx" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Autumn was filled with lot of conferences, events, speaking engagements and many interesting happenings in Skopje, Macedonia.&lt;/p&gt;  &lt;p&gt;First at October 20, I was speaking at &lt;a href="http://weblogs.asp.net/hajan/archive/2011/10/16/speaking-at-ms-vizija-9-conference-on-topic-asp-net-mvc3-amp-razor.aspx" target="_blank"&gt;Microsoft Vizija 9 on topic ASP.NET MVC3 and Razor&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;One week ago, November 15 I was speaking for first time on topic not related to web development (but still deployment of web apps was part of the demos) on topic &lt;a href="http://weblogs.asp.net/hajan/archive/2011/11/13/speaking-at-bizspark-bootcamp-in-skopje-macedonia.aspx" target="_blank"&gt;“Cloud Computing – Windows Azure” at Microsoft BizSpark Bootcamp&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The next event, which is the biggest event by the number of visitors and number of tracks is the &lt;a href="http://codecamp.mkdot.net" target="_blank"&gt;Code Camp 2011 event&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://codecamp.mkdot.net/themes/codecamp/images/cc11-logo.png" alt="Code Camp 2011 Official Logo" /&gt;
&lt;p&gt;After we opened the registrations for the event, we sold out (free) 600 tickets in the first 15 hours! We all got astonished by the extremely big number of responses we’ve got… In this event, I can freely say that we expect about 700 attendees to come, and we already have 900+ registered. The event will be held at Saturday, 26 November 2011.&lt;/p&gt;  &lt;p&gt;At Code Camp 2011, I will &lt;a href="http://codecamp.mkdot.net/page/cc2011-sessions.aspx#session.2.3" target="_blank"&gt;speak on topic ASP.NET MVC Best Practices&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;There are many interesting things to say on this presentation, I will mainly focus on Tips, Tricks, Guidelines and other Practices that I have been using in real-life projects developed by using ASP.NET MVC Framework, with special focus on ASP.NET MVC3 and the next release, ASP.NET MVC4 Developer Preview.&lt;/p&gt;  &lt;p&gt;There are big number of known local and regional &lt;a href="http://codecamp.mkdot.net/page/cc2011-speakers.aspx" target="_blank"&gt;speakers&lt;/a&gt;, including 7 MVPs.&lt;/p&gt;  &lt;p&gt;You can find more info about this event at the official event website: &lt;a href="http://codecamp.mkdot.net"&gt;http://codecamp.mkdot.net&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As for my session, if you have some interesting trick or good practice you have been using in your ASP.NET MVC projects, you can freely share it with me… If I find it interesting and if it’s not part of the current practices I have included for the presentation (I can’t tell you which ones for now… *secret* ;))… I will consider including it in the presentation.&lt;/p&gt;  &lt;p&gt;Stay tuned for more info soon…&lt;/p&gt;  &lt;p&gt;Regards,   &lt;br /&gt;Hajan&lt;/p&gt;</description><pubDate>Mon, 21 Nov 2011 22:46:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/macedonian-code-camp-2011</guid><category>ASP.NET MVC</category><category>code camp</category><category>Community News</category><category>conference</category><category>Macedonian CodeCamp</category><category>Speaking</category></item><item><title>Speaking at BizSpark Bootcamp in Skopje, Macedonia</title><link>https://weblogs.asp.net:443/hajan/speaking-at-bizspark-bootcamp-in-skopje-macedonia</link><description>&lt;div style="margin: 0px; padding: 4px 0px; float: none;" class="wlWriterHeaderFooter"&gt;&lt;iframe style="border: currentColor; width: 450px; height: 80px;" src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/11/13/speaking-at-bizspark-bootcamp-in-skopje-macedonia.aspx" frameBorder="0" scrolling="no" mce_src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/11/13/speaking-at-bizspark-bootcamp-in-skopje-macedonia.aspx"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Tuesday, 15 November 2011, I will be speaking at BizSpark Bootcamp event that will be held at M6 Training Centre in Skopje, Macedonia.&lt;/p&gt;  &lt;p&gt;&lt;img style="width: 300px; height: 250px;" src="https://aspblogs.blob.core.windows.net/media/hajan/events/BIZSPARK_CAMP_300x250.png" width="300" height="250" mce_src="https://aspblogs.blob.core.windows.net/media/hajan/events/BIZSPARK_CAMP_300x250.png"&gt;&lt;/p&gt;  &lt;p&gt;I will speak on topic 'Cloud Computing – Windows Azure' and will be also part of the Q&amp;amp;A panel discussion.&lt;/p&gt;  &lt;p&gt;You can find more details &lt;a href="http://www.gew.com.mk/index.php?view=details&amp;amp;id=116%3Amicrosoft-bizspark-&amp;amp;option=com_eventlist&amp;amp;Itemid=77&amp;amp;lang=en" target="_blank" mce_href="http://www.gew.com.mk/index.php?view=details&amp;amp;id=116%3Amicrosoft-bizspark-&amp;amp;option=com_eventlist&amp;amp;Itemid=77&amp;amp;lang=en"&gt;HERE&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you are near Skopje and available to attend the event, please follow the instructions at the link provided above.&lt;/p&gt;  &lt;p&gt;Regards,   &lt;br&gt;Hajan&lt;/p&gt;</description><pubDate>Sat, 12 Nov 2011 21:33:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/speaking-at-bizspark-bootcamp-in-skopje-macedonia</guid><category>.NET</category><category>Community News</category><category>event</category><category>Speaking</category><category>Windows Azure</category></item><item><title>Time travel issue – “Specified argument was out of the range of valid values. Parameter name: utcDate”</title><link>https://weblogs.asp.net:443/hajan/time-travel-issue-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-utcdate</link><description>&lt;div class="wlWriterHeaderFooter" style="float:none; margin:0px; padding:4px 0px 4px 0px;"&gt;&lt;iframe src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/10/30/time-travel-issue-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-utcdate.aspx" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Few hours ago my wife told me it is time to get some rest, but since I was deep inside code resolving some interesting control flows, the time passed. I was almost done making the last tests before going to sleep when suddenly an interesting issue comes to scene… I refreshed my beautiful website to see the latest changes and ooopsss… the style is not loading properly… I thought it is something with the browser cache (since I didn’t change anything in the styles)… But it wasn’t that. I checked the same with multiple browsers, still my website was plain and ugly, without any styles…&lt;/p&gt;  &lt;p&gt;Orite… lets check the styles and whether the paths are not (somehow) broken or if I am still able to access them… &lt;/p&gt;  &lt;p&gt;I have three stylesheet files:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;common.css &lt;/li&gt;    &lt;li&gt;&lt;font color="#ff0000"&gt;master.css&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;font color="#ff0000"&gt;style.css&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Once I tried to open the red ones by navigating to their location, e.g. &lt;em&gt;http://mywebsite/Content/Styles/master.css&lt;/em&gt; or &lt;em&gt;http://mywebsite/Content/Styles/style.css&lt;/em&gt;, the following error message showed up:&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/TimeTravel/TimeTravel_1.png" /&gt;&lt;/p&gt;  &lt;p&gt;The very first moment I was like… ops… what the hell… however, after several seconds I just looked at my clock and saw the current time is 02:04 AM. Why is important my current time with relation to the issue??? Well, it is because five minutes ago the time was 02:59… You wonder what happened? The clock got set back 1 hour because the Daylight Saving Time ended several minutes ago, October 30, at 3:00 AM (gets back 1 hour to 2:00 AM).&lt;/p&gt;  &lt;p&gt;Ok. That’s perfectly fine, but why this confusing problem appears?&lt;/p&gt;  &lt;p&gt;The answer is simple… The assembly was created with time 02:59 AM, 30 October, 2011. The time now is 02:04 AM, 30 October, 2011, which means we have traveled in the future :-)… hah, in other words, the assembly was last modified in future time, therefore the utcDate is out of the range of valid values.&lt;/p&gt;  &lt;p&gt;A fast solution is to either change your time in the future or best would be to uncheck ‘Automatically adjust clock for Daylight Saving Time’&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/TimeTravel/TimeTravel_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;After that I simply refreshed my website and everything got back to normal!&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://mkdot.net/blogs/hajan/archive/2011/10/30/time-travel-issue-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-utcdate.aspx" target="_blank"&gt;Reference post from my other blog at mkdot.net&lt;/a&gt;
&lt;/p&gt;</description><pubDate>Sun, 30 Oct 2011 01:33:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/time-travel-issue-specified-argument-was-out-of-the-range-of-valid-values-parameter-name-utcdate</guid><category>ASP.NET</category></item><item><title>Speaking at MS Vizija 9 Conference on topic ASP.NET MVC3 &amp; Razor</title><link>https://weblogs.asp.net:443/hajan/speaking-at-ms-vizija-9-conference-on-topic-asp-net-mvc3-amp-razor</link><description>&lt;div class="wlWriterHeaderFooter" style="float:none; margin:0px; padding:4px 0px 4px 0px;"&gt;&lt;iframe src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/10/16/speaking-at-ms-vizija-9-conference-on-topic-asp-net-mvc3-amp-razor.aspx" mce_src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/10/16/speaking-at-ms-vizija-9-conference-on-topic-asp-net-mvc3-amp-razor.aspx" style="border:none; width:450px; height:80px" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;October 20 (Thursday), I will be speaking at &lt;a href="http://www.msvizija.net" mce_href="http://www.msvizija.net" target="_blank"&gt;Microsoft Vizija Conference&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;   &lt;br&gt;&lt;b&gt;&lt;u&gt;Presentation Details&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Presentation title: &lt;b&gt;ASP.NET MVC3 &amp;amp; Razor&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;The main objective of the presentation is to show the real power of ASP.NET MVC3 and the key benefits of using ASP.NET MVC3 and Razor View Engine.&lt;/p&gt;  &lt;p&gt;Presentation will last 60 minutes in the Development Track.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;u&gt;       &lt;br&gt;About Microsoft Vizija&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Microsoft Vizija Conference will be held at Hotel Alexander Palace in Skopje, Macedonia.&lt;/p&gt;  &lt;p&gt;This is two-days conference with a lot of presentations, many known speakers including MSFTs, RDs and MVPs.&lt;/p&gt;  &lt;p&gt;Useful links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.msvizija.net" mce_href="http://www.msvizija.net" target="_blank"&gt;MS Vizija Official Website&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="https://www.msvizija.net/vizija9/konferencija/Pages/Predavaci.aspx" mce_href="https://www.msvizija.net/vizija9/konferencija/Pages/Predavaci.aspx" target="_blank"&gt;List of Speakers&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="https://www.msvizija.net/vizija9/konferencija/Pages/Agenda.aspx" mce_href="https://www.msvizija.net/vizija9/konferencija/Pages/Agenda.aspx" target="_blank"&gt;Presentations Agenda&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br&gt;If you are coming, meet you there!&lt;/p&gt;  &lt;p&gt;Hajan&lt;/p&gt;</description><pubDate>Sun, 16 Oct 2011 17:41:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/speaking-at-ms-vizija-9-conference-on-topic-asp-net-mvc3-amp-razor</guid><category>ASP.NET</category><category>ASP.NET MVC</category><category>Community News</category><category>conference</category><category>Razor</category><category>Speaking</category></item><item><title>Squish your CSS and JS files in your ASP.NET web apps</title><link>https://weblogs.asp.net:443/hajan/squish-your-css-and-js-files-in-your-asp-net-web-apps</link><description>&lt;div class="wlWriterHeaderFooter" style="float:none; margin:0px; padding:4px 0px 4px 0px;"&gt;&lt;iframe src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/10/03/squish-your-css-and-js-files-in-your-asp-net-web-apps.aspx" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;SquishIt is a nice library that helps you nicely minify your CSS and JavaScript files with very small effort. &lt;/p&gt;  &lt;p&gt;The tool works perfectly fine in both ASP.NET WebForms and ASP.NET MVC and is available to get &amp;amp; install using NuGet package manager.&lt;/p&gt;  &lt;p&gt;Open NuGet package manager or NuGet Manager PowerShell Console..&lt;/p&gt;  &lt;p&gt;NuGet package manager:&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_1.png" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;As you can see, SquishIt is available for both ASP.NET and ASP.NET MVC.&lt;/p&gt;  &lt;p&gt;NuGet PowerShell Console:&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_3.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_4.png" /&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Now, lets add our CSS and JS files that we want to Squish.&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_5.png" /&gt;&lt;/p&gt;  &lt;p&gt;SquishIt has two functions for CSS and JavaScript. The method Render does the squishing. As you can see, we use ‘#’ where the method will auto-generate unique id for the script.&lt;/p&gt;  &lt;p&gt;Once you run your web, open source code and check the rendered CSS/JS files&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_6.png" /&gt;&lt;/p&gt;  &lt;p&gt;Since SquishIt works based on the Debug setting in Web.config&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;compilation &lt;/span&gt;&lt;span style="color: red"&gt;debug&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;true&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;targetFramework&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;4.0&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;change the debug setting to &lt;strong&gt;false&lt;/strong&gt; and run the web again…&lt;/p&gt;

&lt;p&gt;Now, if you open the source code in your browser, you will see two files for both, CSS and JS files squished!&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_7.png" /&gt;&lt;/p&gt;

&lt;p&gt;You will see that SquishIt has created the new files in the respective folders&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_8.png" /&gt;&lt;/p&gt;

&lt;p&gt;If we open the squished file, you will see it is minified&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/SquishIt/WebForms/SquishIt_9.png" /&gt;&lt;/p&gt;

&lt;p&gt;SquishIt works exactly the same way for ASP.NET MVC!&lt;/p&gt;

&lt;p&gt;Hope this was helpful.&lt;/p&gt;

&lt;p&gt;Regards,
  &lt;br /&gt;Hajan&lt;/p&gt;</description><pubDate>Mon, 03 Oct 2011 19:20:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/squish-your-css-and-js-files-in-your-asp-net-web-apps</guid><category>ASP.NET</category><category>Minification</category><category>Minify</category><category>Squish</category><category>SquishIt</category></item><item><title>Simple, fast and useful MiniProfiler for ASP.NET MVC</title><link>https://weblogs.asp.net:443/hajan/simple-fast-and-useful-mini-profiler-for-asp-net-mvc</link><description>&lt;div class="wlWriterHeaderFooter" style="float:none; margin:0px; padding:4px 0px 4px 0px;"&gt;&lt;iframe src="http://www.facebook.com/widgets/like.php?href=http://weblogs.asp.net/hajan/archive/2011/09/20/simple-fast-and-useful-mini-profiler-for-asp-net-mvc.aspx" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;MiniProfiler is very lightweight, simple, fast and useful profiler for ASP.NET websites including ASP.NET MVC. It is designed to help you find possible performance issues and have very nice and clear view over each operation that happens in your web applications.&lt;/p&gt;  &lt;p&gt;MiniProfiler was created by the &lt;a href="http://stackoverflow.com/" target="_blank"&gt;Stack Overflow&lt;/a&gt; guys for their internal use, but they have put it as an open source project under &lt;a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"&gt;Apache License 2.0&lt;/a&gt; for all ASP.NET and WCF developers! (Thanks guys!)&lt;/p&gt;  &lt;p&gt;To get started using MiniProfiler, you have to install it first.&lt;/p&gt;  &lt;p&gt;You have two options available:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Installation&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1. Using &lt;a href="http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c" target="_blank"&gt;NuGet Package Manager&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;- In VS.NET 2010, go to Tools –&amp;gt; Library Package Manager –&amp;gt; Manage NuGet Packages…&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_1.png" /&gt;&lt;/p&gt;  &lt;p&gt;Install MiniProfiler.MVC3&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_2.png" width="771" height="511" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_3.png" /&gt;&lt;/p&gt;  &lt;p&gt;Once installation is successful, both MiniProfiler will be ticked.&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_4.png" width="760" height="508" /&gt;&lt;/p&gt;  &lt;p&gt;If you want to use MiniProfiler for Entity Framework too, then install the MiniProfiler.EF too.&lt;/p&gt;  &lt;p&gt;2. Install manually from &lt;a href="http://code.google.com/p/mvc-mini-profiler/"&gt;here&lt;/a&gt; (you have &lt;a href="https://github.com/SamSaffron/MiniProfiler" target="_blank"&gt;github clone&lt;/a&gt; too)     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Setting up&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Once you are done with installation, if you have used NuGet manager to install MiniProfiler, you are almost done&lt;/p&gt;  &lt;p&gt;The new dlls added by the NuGet are marked:&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_5.png" /&gt;&lt;/p&gt;  &lt;p&gt;Besides dlls, there is also a MiniProfiler.cs class inside App_Start folder&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_6.png" /&gt;&lt;/p&gt;  &lt;p&gt;The next thing you need to do is to include MiniProfiler in the master layout page. Once you expand the Views –&amp;gt; Shared, you can see that with installing MiniProfiler there is _MINIPROFILER UPDATED Layout.cshtml that is an example master layout regarding how to include MiniProfiler in your Layout page.&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_7.png" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_8.png" /&gt;&lt;/p&gt;  &lt;p&gt;Copy the marked line and add it to your actual _Layout.cshtml&lt;/p&gt;  &lt;p&gt;In my example:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: maroon"&gt;DOCTYPE &lt;/span&gt;&lt;span style="color: red"&gt;html&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;html&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;ViewBag.Title&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;    
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;link &lt;/span&gt;&lt;span style="color: red"&gt;href&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;&lt;span style="color: blue"&gt;Url.Content(&lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;quot;~/Content/Site.css&amp;quot;&lt;/span&gt;&lt;span style="color: blue"&gt;)&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;rel&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;stylesheet&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/css&amp;quot; /&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;&lt;span style="color: blue"&gt;Url.Content(&lt;/span&gt;&lt;span style="color: #a31515"&gt;&amp;quot;~/Scripts/jquery-1.4.4.min.js&amp;quot;&lt;/span&gt;&lt;span style="color: blue"&gt;)&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;MvcMiniProfiler.&lt;span style="color: #2b91af"&gt;MiniProfiler&lt;/span&gt;.RenderIncludes()
&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;

&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;body&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;RenderBody()
&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;body&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;html&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;
    &lt;br /&gt;&lt;u&gt;Using MiniProfiler&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, run your application… you can see MiniProfiler is running in the top left corner:&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_9.png" /&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_10.png" /&gt;&lt;/p&gt;

&lt;p&gt;If you want to see what does MiniProfiler includes for us, check View Source in your browser: 
  &lt;br /&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_11.png" width="750" height="435" /&gt;&lt;/p&gt;

&lt;p&gt;If you want to start the mini profiler for specific requests only (e.g. local requests), you can use MiniProfiler.Start() method. The best place to add this is in the Global.asax Application_BeginRequest.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Grouping Profiler Steps&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using MiniProfiler we can group profiling steps very easily. Yep, this might make your code in some segments a bit more dirty, but if you have clean code you should no worry…&lt;/p&gt;

&lt;p&gt;To perform grouping by steps in your Controller, first add using MvcMiniprofiler; directive&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;MvcMiniProfiler;&lt;/pre&gt;

&lt;p&gt;Create instance of MiniProfiler by adding the MiniProfiler.Current that represents the currently running profiler in the HttpContext&lt;/p&gt;

&lt;p&gt;Use the Step() method in using code block to create profiler step.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Then in my Products ActionResult add the following code:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Products()
{
    &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Product&lt;/span&gt;&amp;gt; listProducts = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Product&lt;/span&gt;&amp;gt;();
    
    &lt;span style="color: #2b91af"&gt;MiniProfiler &lt;/span&gt;profiler = &lt;span style="color: #2b91af"&gt;MiniProfiler&lt;/span&gt;.Current;
    
    &lt;span style="color: blue"&gt;using &lt;/span&gt;(profiler.Step(&lt;span style="color: #a31515"&gt;&amp;quot;Load Product Items&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;ProfileLevel&lt;/span&gt;.Info))
    {
        System.Threading.&lt;span style="color: #2b91af"&gt;Thread&lt;/span&gt;.Sleep(1000); &lt;span style="color: green"&gt;//1 second sleep
        &lt;/span&gt;listProducts.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Product&lt;/span&gt;() { ProductID = 1, Name = &lt;span style="color: #a31515"&gt;&amp;quot;Product 1&amp;quot;&lt;/span&gt;, Price = 100 });                
        listProducts.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Product&lt;/span&gt;() { ProductID = 2, Name = &lt;span style="color: #a31515"&gt;&amp;quot;Product 2&amp;quot;&lt;/span&gt;, Price = 200 });                
        listProducts.Add(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Product&lt;/span&gt;() { ProductID = 2, Name = &lt;span style="color: #a31515"&gt;&amp;quot;Product 3&amp;quot;&lt;/span&gt;, Price = 300 });            }

    &lt;span style="color: blue"&gt;using &lt;/span&gt;(profiler.Step(&lt;span style="color: #a31515"&gt;&amp;quot;Add Products to List&amp;quot;&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;ProfileLevel&lt;/span&gt;.Info))
    {
        System.Threading.&lt;span style="color: #2b91af"&gt;Thread&lt;/span&gt;.Sleep(2000); &lt;span style="color: green"&gt;//2 seconds sleep
        &lt;/span&gt;ViewBag.Products = listProducts;
    }

    &lt;span style="color: blue"&gt;return &lt;/span&gt;View();
}&lt;/pre&gt;


&lt;p&gt;In this example we have two profiler steps: &lt;strong&gt;Load Product Items&lt;/strong&gt; and &lt;strong&gt;Add Products to List&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now add new View to display products list by right clicking somewhere above the code in Products() method and Add View with name Products.&lt;/p&gt;

&lt;p&gt;In the view add the following code (just for the demo…):&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="background: yellow"&gt;@{
&lt;/span&gt;    ViewBag.Title = &lt;span style="color: #a31515"&gt;&amp;quot;Products&amp;quot;&lt;/span&gt;;
    Layout = &lt;span style="color: #a31515"&gt;&amp;quot;~/Views/Shared/_Layout.cshtml&amp;quot;&lt;/span&gt;;
&lt;span style="background: yellow"&gt;}

&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Products&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;h2&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;p&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;ul&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;&lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;item &lt;span style="color: blue"&gt;in &lt;/span&gt;ViewBag.Products)
        {
            &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &lt;/span&gt;&lt;span style="background: yellow"&gt;@&lt;/span&gt;item.Name ($&lt;span style="background: yellow"&gt;@&lt;/span&gt;item.Price)
            &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;li&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &lt;/span&gt;}
    &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;ul&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;p&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;



&lt;p&gt;Now run the web page and navigate to /Home/Products&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_12.png" /&gt;&lt;/p&gt;

&lt;p&gt;once you click the button at the top-left corner you will get this:&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_13.png" /&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Profiling Database Queries&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To use MiniProfiler for profiling database queries, first you will need to de-comment one (or both) of the database related line/s inside App_Start/MiniProfiler.cs PreStart() method&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: green"&gt;//TODO: To profile a standard DbConnection: 
// var profiled = new ProfiledDbConnection(cnn, MiniProfiler.Current);

//TODO: If you are profiling EF code first try: 
 &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MiniProfilerEF&lt;/span&gt;.Initialize();&lt;/pre&gt;

&lt;p&gt;In our example I will be using the EF Mini Profiler.&lt;/p&gt;

&lt;p&gt;First, I have rewritten the Products method with the following code:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Products()
{  
    &lt;span style="color: #2b91af"&gt;AdventureWorksEntities &lt;/span&gt;context = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;AdventureWorksEntities&lt;/span&gt;();

    ViewBag.Products = (&lt;span style="color: blue"&gt;from &lt;/span&gt;p &lt;span style="color: blue"&gt;in &lt;/span&gt;context.Products
                        &lt;span style="color: blue"&gt;join &lt;/span&gt;pm &lt;span style="color: blue"&gt;in &lt;/span&gt;context.ProductModels &lt;span style="color: blue"&gt;on &lt;/span&gt;p.ProductModelID &lt;span style="color: blue"&gt;equals &lt;/span&gt;pm.ProductModelID
                        &lt;span style="color: blue"&gt;join &lt;/span&gt;pmx &lt;span style="color: blue"&gt;in &lt;/span&gt;context.ProductModelProductDescriptionCultures &lt;span style="color: blue"&gt;on &lt;/span&gt;pm.ProductModelID &lt;span style="color: blue"&gt;equals &lt;/span&gt;pmx.ProductModelID
                        &lt;span style="color: blue"&gt;join &lt;/span&gt;pd &lt;span style="color: blue"&gt;in &lt;/span&gt;context.ProductDescriptions &lt;span style="color: blue"&gt;on &lt;/span&gt;pmx.ProductDescriptionID &lt;span style="color: blue"&gt;equals &lt;/span&gt;pd.ProductDescriptionID
                        &lt;span style="color: blue"&gt;select new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ProductViewModel
                        &lt;/span&gt;{
                            ProductID = p.ProductID,
                            Name = p.Name,
                            Description = pd.Description.Substring(0, 200)
                        });

    &lt;span style="color: blue"&gt;return &lt;/span&gt;View();
}&lt;/pre&gt;

&lt;p&gt;

  &lt;br /&gt;I am using AdventureWorks database with EF. I have added one query that joins four tables. Now just run the application.&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_14.png" width="864" height="526" /&gt;&lt;/p&gt;

&lt;p&gt;if we click on &lt;u&gt;1 sql&lt;/u&gt;, the MiniProfiler will give us some detailed info regarding generated SQL query and the time needed to execute and finish&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_15.png" width="917" height="149" /&gt;&lt;/p&gt;

&lt;p&gt;If we have some query that is executing very long or we have multiple queries which create performance issues, MiniProfiler will give us warnings…&lt;/p&gt;

&lt;p&gt;For example, lets add loop of executing the above query 50 times&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Products()
{                        
    &lt;span style="color: #2b91af"&gt;AdventureWorksEntities &lt;/span&gt;context = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;AdventureWorksEntities&lt;/span&gt;();

    &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ProductViewModel&lt;/span&gt;&amp;gt; productList = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ProductViewModel&lt;/span&gt;&amp;gt;();
    
    &lt;span style="color: blue"&gt;for &lt;/span&gt;(&lt;span style="color: blue"&gt;int &lt;/span&gt;i = 0; i &amp;lt; 50; i++)
    {
        productList.AddRange(&lt;span style="color: blue"&gt;from &lt;/span&gt;p &lt;span style="color: blue"&gt;in &lt;/span&gt;context.Products
                       &lt;span style="color: blue"&gt;join &lt;/span&gt;pm &lt;span style="color: blue"&gt;in &lt;/span&gt;context.ProductModels &lt;span style="color: blue"&gt;on &lt;/span&gt;p.ProductModelID &lt;span style="color: blue"&gt;equals &lt;/span&gt;pm.ProductModelID
                       &lt;span style="color: blue"&gt;join &lt;/span&gt;pmx &lt;span style="color: blue"&gt;in &lt;/span&gt;context.ProductModelProductDescriptionCultures &lt;span style="color: blue"&gt;on &lt;/span&gt;pm.ProductModelID &lt;span style="color: blue"&gt;equals &lt;/span&gt;pmx.ProductModelID
                       &lt;span style="color: blue"&gt;join &lt;/span&gt;pd &lt;span style="color: blue"&gt;in &lt;/span&gt;context.ProductDescriptions &lt;span style="color: blue"&gt;on &lt;/span&gt;pmx.ProductDescriptionID &lt;span style="color: blue"&gt;equals &lt;/span&gt;pd.ProductDescriptionID
                       &lt;span style="color: blue"&gt;orderby &lt;/span&gt;p.Name &lt;span style="color: blue"&gt;descending&lt;/span&gt;, p.ProductID &lt;span style="color: blue"&gt;ascending&lt;/span&gt;, pd.Description &lt;span style="color: blue"&gt;descending&lt;/span&gt;, pd.ModifiedDate &lt;span style="color: blue"&gt;descending
                       select new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ProductViewModel
                       &lt;/span&gt;{
                           ProductID = p.ProductID,
                           Name = p.Name,
                           Description = pd.Description.Substring(0, 200)
                       });
    }

    ViewBag.Products = productList;

    &lt;span style="color: blue"&gt;return &lt;/span&gt;View();
}&lt;/pre&gt;

&lt;p&gt;Once we run the app, it will take few seconds to load…&lt;/p&gt;

&lt;p&gt;&lt;img src="https://aspblogs.blob.core.windows.net/media/hajan/postimages2011/ASPNETMVC_MiniProfiler/aspnet_miniprofiler_16.png" width="942" height="327" /&gt;&lt;/p&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ASP.NET MVC MiniProfiler is a great tool that you must have in your toolset for building scalable, fast and performance optimized web applications. You can have clear view of what is causing performance issues in your application in almost all levels and layers.&lt;/p&gt;

&lt;p&gt;For those that are interested to get access to the MiniProfiler source code and want to dig more, check &lt;a href="http://code.google.com/p/mvc-mini-profiler/source/checkout" target="_blank"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;
  &lt;br /&gt;I hope this was useful blog post for you.&lt;/p&gt;

&lt;p&gt;Regards,
  &lt;br /&gt;Hajan&lt;/p&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;strong&gt;&lt;em&gt;Similar readings&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/2011/06/14/miniprofiler-lightweight-profiler-for-asp-net-web-applications.aspx" target="_blank"&gt;MiniProfiler: Lightweight profiler for ASP.NET web applications&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://code.google.com/p/mvc-mini-profiler/" target="_blank"&gt;MVC Mini Profiler Project Home&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description><pubDate>Mon, 26 Sep 2011 19:58:00 GMT</pubDate><guid isPermaLink="true">https://weblogs.asp.net:443/hajan/simple-fast-and-useful-mini-profiler-for-asp-net-mvc</guid><category>ASP.NET</category><category>ASP.NET MVC</category><category>MiniProfiler</category></item></channel></rss>