<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Anubhav Goyal</title>
	<atom:link href="http://anubhavg.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://anubhavg.wordpress.com</link>
	<description>design and development with .Net</description>
	<lastBuildDate>Sat, 21 Jan 2012 06:00:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='anubhavg.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Anubhav Goyal</title>
		<link>http://anubhavg.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://anubhavg.wordpress.com/osd.xml" title="Anubhav Goyal" />
	<atom:link rel='hub' href='http://anubhavg.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Add custom messages to Validation Summary in asp.net mvc form</title>
		<link>http://anubhavg.wordpress.com/2011/11/02/add-custom-messages-to-validation-summary-in-asp-net-mvc-form/</link>
		<comments>http://anubhavg.wordpress.com/2011/11/02/add-custom-messages-to-validation-summary-in-asp-net-mvc-form/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 23:21:27 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp .net]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=142</guid>
		<description><![CDATA[Sometimes you might need to add messages to Validation summary. Here is a small javascript function that will help you do that. The method can be called onClick event of a button. function performValidation() {         if ($("#notestext").val() == "") {             var ul = $("#validationSummary ul");             ul.html("");             ul.append("&#60;li&#62;" + "Action Note must [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=142&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you might need to add messages to Validation summary. Here is a small javascript function that will help you do that. The method can be called onClick event of a button.</p>
<pre>    function performValidation() {
        if ($("#notestext").val() == "") {
            var ul = $("#validationSummary ul");
            ul.html("");
            ul.append("&lt;li&gt;" + "Action Note must be entered." + "&lt;/li&gt;");
            return false;
        }
        return true;
    }</pre>
<p>Hope it helps</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=142&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/11/02/add-custom-messages-to-validation-summary-in-asp-net-mvc-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>How to find all values that have changes in mvc object</title>
		<link>http://anubhavg.wordpress.com/2011/10/27/how-to-find-all-values-that-have-changes-in-mvc-object/</link>
		<comments>http://anubhavg.wordpress.com/2011/10/27/how-to-find-all-values-that-have-changes-in-mvc-object/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 02:44:48 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp .net]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=137</guid>
		<description><![CDATA[&#8216;Compare the original and new versions of any db model, return a string of changes     Function GetChanges(ByRef database As YourCaretakerEntities, ByRef originalValues As Object, ByRef newValues As Object) As String         Dim returnString As New StringBuilder()         Dim comparer As ObjectStateEntry = database.ObjectStateManager.GetObjectStateEntry(originalValues)         For Each changedField In comparer.GetModifiedProperties()             returnString.Append(changedField)             returnString.Append(&#8221; changed from &#8220;)             returnString.Append(comparer.OriginalValues(changedField).ToString())             returnString.Append(&#8221; to &#8220;)             returnString.Append(comparer.CurrentValues(changedField).ToString())             returnString.Append(&#8220;, &#8220;)         Next         If returnString.Length &#62; 0 Then returnString = returnString.Replace(&#8220;, &#8220;, &#8220;.&#8221;, returnString.Length &#8211; 2, 2)         Return returnString.ToString()     End Function<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=137&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div align="left"><span style="color:#008000;font-family:Consolas;">&#8216;Compare the original and new versions of any db model, return a string of changes</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">    </span><span style="color:#0000ff;font-family:Consolas;">Function</span><span style="color:#010101;font-family:Consolas;"> GetChanges(</span><span style="color:#0000ff;font-family:Consolas;">ByRef</span><span style="color:#010101;font-family:Consolas;"> database </span><span style="color:#0000ff;font-family:Consolas;">As</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#2b91af;font-family:Consolas;">YourCaretakerEntities</span><span style="color:#010101;font-family:Consolas;">, </span><span style="color:#0000ff;font-family:Consolas;">ByRef</span><span style="color:#010101;font-family:Consolas;"> originalValues </span><span style="color:#0000ff;font-family:Consolas;">As</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#0000ff;font-family:Consolas;">Object</span><span style="color:#010101;font-family:Consolas;">, </span><span style="color:#0000ff;font-family:Consolas;">ByRef</span><span style="color:#010101;font-family:Consolas;"> newValues </span><span style="color:#0000ff;font-family:Consolas;">As</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#0000ff;font-family:Consolas;">Object</span><span style="color:#010101;font-family:Consolas;">) </span><span style="color:#0000ff;font-family:Consolas;">As</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#0000ff;font-family:Consolas;">String</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">        </span><span style="color:#0000ff;font-family:Consolas;">Dim</span><span style="color:#010101;font-family:Consolas;"> returnString </span><span style="color:#0000ff;font-family:Consolas;">As</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#0000ff;font-family:Consolas;">New</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#2b91af;font-family:Consolas;">StringBuilder</span><span style="color:#010101;font-family:Consolas;">()</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">        </span><span style="color:#0000ff;font-family:Consolas;">Dim</span><span style="color:#010101;font-family:Consolas;"> comparer </span><span style="color:#0000ff;font-family:Consolas;">As</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#2b91af;font-family:Consolas;">ObjectStateEntry</span><span style="color:#010101;font-family:Consolas;"> = database.ObjectStateManager.GetObjectStateEntry(originalValues)</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">        </span><span style="color:#0000ff;font-family:Consolas;">For</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#0000ff;font-family:Consolas;">Each</span><span style="color:#010101;font-family:Consolas;"> changedField </span><span style="color:#0000ff;font-family:Consolas;">In</span><span style="color:#010101;font-family:Consolas;"> comparer.GetModifiedProperties()</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">            returnString.Append(changedField)</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">            returnString.Append(</span><span style="color:#a31515;font-family:Consolas;">&#8221; changed from &#8220;</span><span style="color:#010101;font-family:Consolas;">)</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">            returnString.Append(comparer.OriginalValues(changedField).ToString())</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">            returnString.Append(</span><span style="color:#a31515;font-family:Consolas;">&#8221; to &#8220;</span><span style="color:#010101;font-family:Consolas;">)</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">            returnString.Append(comparer.CurrentValues(changedField).ToString())</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">            returnString.Append(</span><span style="color:#a31515;font-family:Consolas;">&#8220;, &#8220;</span><span style="color:#010101;font-family:Consolas;">)</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">        </span><span style="color:#0000ff;font-family:Consolas;">Next</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">        </span><span style="color:#0000ff;font-family:Consolas;">If</span><span style="color:#010101;font-family:Consolas;"> returnString.Length &gt; 0 </span><span style="color:#0000ff;font-family:Consolas;">Then</span><span style="color:#010101;font-family:Consolas;"> returnString = returnString.Replace(</span><span style="color:#a31515;font-family:Consolas;">&#8220;, &#8220;</span><span style="color:#010101;font-family:Consolas;">, </span><span style="color:#a31515;font-family:Consolas;">&#8220;.&#8221;</span><span style="color:#010101;font-family:Consolas;">, returnString.Length &#8211; 2, 2)</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">        </span><span style="color:#0000ff;font-family:Consolas;">Return</span><span style="color:#010101;font-family:Consolas;"> returnString.ToString()</span></div>
<div align="left"><span style="color:#010101;font-family:Consolas;">    </span><span style="color:#0000ff;font-family:Consolas;">End</span><span style="color:#010101;font-family:Consolas;"> </span><span style="color:#0000ff;font-family:Consolas;">Function</span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=137&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/10/27/how-to-find-all-values-that-have-changes-in-mvc-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>Handle Access Denied in asp.net MVC</title>
		<link>http://anubhavg.wordpress.com/2011/10/18/handle-access-denied-in-asp-net-mvc/</link>
		<comments>http://anubhavg.wordpress.com/2011/10/18/handle-access-denied-in-asp-net-mvc/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 00:39:40 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp .net]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=120</guid>
		<description><![CDATA[Today I had to add security to the application. Essentially check if the logged in user has got permission to access a function and if not redirect to Unauthorised page. There may be a few ways this can be achieved. Some developers may prefer to add if else check in the view and depending if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=120&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I had to add security to the application. Essentially check if the logged in user has got permission to access a function and if not redirect to Unauthorised page. There may be a few ways this can be achieved. Some developers may prefer to add if else check in the view and depending if access needs to be granted they show selective part of the view. This will work, but I think there is a more elegant way to handle this. This is how I achieved this.</p>
<p>Create an attribute that will redirect unauthorised access to a SecurityController. In order to show custom unauthorised messages, it should allow specific messages which can be achieved by passing a reason string.</p>
<p>Here is the code for security attribute: (its in vb.net, but I am sure you can convert to C# easily)</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">&lt;<span style="color:#2b91af;">AttributeUsage</span>(<span style="color:#2b91af;">AttributeTargets</span>.Method, AllowMultiple:=<span style="color:blue;">True</span>, Inherited:=<span style="color:blue;">True</span>)&gt; _</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;color:blue;">Public</span><span style="font-size:9.5pt;font-family:Consolas;"> <span style="color:blue;">NotInheritable</span> <span style="color:blue;">Class</span> <span style="color:#2b91af;">ApplySecurityAttribute</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Inherits</span> <span style="color:#2b91af;">ActionFilterAttribute</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Private</span> <span style="color:blue;">ReadOnly</span> _permission <span style="color:blue;">As</span> <span style="color:blue;">Integer</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Public</span> <span style="color:blue;">Sub</span> <span style="color:blue;">New</span>(<span style="color:blue;">ByVal</span> permission <span style="color:blue;">As</span> <span style="color:blue;">Integer</span>)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">Me</span>.New(permission, <span style="color:blue;">String</span>.Empty)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Public</span> <span style="color:blue;">Sub</span> <span style="color:blue;">New</span>(<span style="color:blue;">ByVal</span> permission <span style="color:blue;">As</span> <span style="color:blue;">Integer</span>, <span style="color:blue;">ByVal</span> reason_1 <span style="color:blue;">As</span> <span style="color:blue;">String</span>)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        _permission = permission</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        Reason = reason_1</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Public</span> <span style="color:blue;">Property</span> Reason() <span style="color:blue;">As</span> <span style="color:blue;">String</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">Get</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            <span style="color:blue;">Return</span> m_Reason</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">End</span> <span style="color:blue;">Get</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">Set</span>(<span style="color:blue;">ByVal</span> value <span style="color:blue;">As</span> <span style="color:blue;">String</span>)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            m_Reason = Value</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">End</span> <span style="color:blue;">Set</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">End</span> <span style="color:blue;">Property</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Private</span> m_Reason <span style="color:blue;">As</span> <span style="color:blue;">String</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">Public</span> <span style="color:blue;">Overrides</span> <span style="color:blue;">Sub</span> OnActionExecuting(<span style="color:blue;">ByVal</span> filterContext <span style="color:blue;">As</span> <span style="color:#2b91af;">ActionExecutingContext</span>)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">If</span> <span style="color:blue;">Not</span> <span style="color:#2b91af;">PermissionsManager</span>.HasPermission(_permission) <span style="color:blue;">Then</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            <span style="color:green;">&#8216; Put security check here</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            <span style="color:green;">&#8216; Security Controller</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            <span style="color:green;">&#8216; Unauthorized Action</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            <span style="color:green;">&#8216; Put the reason here</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            <span style="color:blue;">Dim</span> routeValueDictionary = <span style="color:blue;">New</span> <span style="color:#2b91af;">RouteValueDictionary</span>() <span style="color:blue;">From</span> { _</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">             {<span style="color:#a31515;">&#8220;controller&#8221;</span>, <span style="color:#a31515;">&#8220;Security&#8221;</span>}, _</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">             {<span style="color:#a31515;">&#8220;action&#8221;</span>, <span style="color:#a31515;">&#8220;Unauthorized&#8221;</span>}, _</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">             {<span style="color:#a31515;">&#8220;reason&#8221;</span>, Reason} _</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            }</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">            filterContext.Result = <span style="color:blue;">New</span> <span style="color:#2b91af;">RedirectToRouteResult</span>(routeValueDictionary)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">End</span> <span style="color:blue;">If</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">        <span style="color:blue;">MyBase</span>.OnActionExecuting(filterContext)</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;">    <span style="color:blue;">End</span> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:9.5pt;font-family:Consolas;color:blue;">End</span><span style="font-size:9.5pt;font-family:Consolas;"> <span style="color:blue;">Class</span></span></p>
<p class="MsoNormal">Using the attribute is simple. Just declare it on a controller like this:</p>
<pre>&lt;ApplySecurity(Enums.Permissions.OfficeUserViewReports, "You are not authorised to view reports")&gt;</pre>
<p>Here is the Security Controller class.</p>
<pre>Namespace YourCaretaker
    Public Class SecurityController
        Inherits System.Web.Mvc.Controller
        Function Unauthorized(ByVal reason As String) As ViewResult
           ViewBag.Reason = reason
            Return View()
        End Function
    End Class
End Namespace</pre>
<p>And finally the permission manager</p>
<pre>Public NotInheritable Class PermissionsManager
    Private Sub New()
    End Sub
    Public Shared Function HasPermission(ByVal permissionId As Integer) As Boolean
        'insert your implementation
        'if access allowed Return True else Return False
    End Function
End Class</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=120&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/10/18/handle-access-denied-in-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>How to get date 3 days before today</title>
		<link>http://anubhavg.wordpress.com/2011/10/12/how-to-get-date-3-days-before-today/</link>
		<comments>http://anubhavg.wordpress.com/2011/10/12/how-to-get-date-3-days-before-today/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 23:48:31 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=117</guid>
		<description><![CDATA[Its pretty simple really&#8230; DateTime.Now.AddDays(-3) Cheers<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=117&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Its pretty simple really&#8230;</p>
<p>DateTime.Now.AddDays(-3)</p>
<p>Cheers</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=117&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/10/12/how-to-get-date-3-days-before-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP MVC 3rd Party Controls</title>
		<link>http://anubhavg.wordpress.com/2011/09/29/asp-mvc-3rd-party-controls/</link>
		<comments>http://anubhavg.wordpress.com/2011/09/29/asp-mvc-3rd-party-controls/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 22:37:30 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=115</guid>
		<description><![CDATA[If you are looking for MVC Ajax controls to speed up application development, here are a few good ones, I think the best are Telerik, not free free http://mvccontrolstoolkit.codeplex.com/ about USD 1999 http://www.devexpress.com/Products/NET/Controls/ASP/ http://www.obout.com/inc/download.aspx#mvc And ofcourse with lit bit of effort and fun you can integrate Jq* controls such as Grid, Date, Autocomplete, Modal box<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=115&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are looking for MVC Ajax controls to speed up application development, here are a few good ones, </p>
<p>I think the best are Telerik, not free</p>
<p>free http://mvccontrolstoolkit.codeplex.com/</p>
<p>about USD 1999 http://www.devexpress.com/Products/NET/Controls/ASP/ </p>
<p>http://www.obout.com/inc/download.aspx#mvc</p>
<p>And ofcourse with lit bit of effort and fun you can integrate Jq* controls such as Grid, Date, Autocomplete, Modal box</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=115&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/09/29/asp-mvc-3rd-party-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>JSON undefined</title>
		<link>http://anubhavg.wordpress.com/2011/09/22/json-undefined/</link>
		<comments>http://anubhavg.wordpress.com/2011/09/22/json-undefined/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 04:44:52 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[asp .net]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=110</guid>
		<description><![CDATA[Here are some scripts that you can implement in your own javascript tag, class to implement json serialisation and parsing var JSON = JSON &#124;&#124; {}; // implement JSON.stringify serialization JSON.stringify = JSON.stringify &#124;&#124; function(obj) { var t = typeof (obj); if (t != "object" &#124;&#124; obj === null) { // simple data type if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=110&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are some scripts that you can implement in your own javascript tag, class to implement json serialisation and parsing</p>
<p><code>var JSON = JSON || {};<br />
// implement JSON.stringify serialization<br />
JSON.stringify = JSON.stringify || function(obj) {<br />
var t = typeof (obj);<br />
if (t != "object" || obj === null) {<br />
// simple data type<br />
if (t == "string")<br />
obj = '"' + obj + '"';<br />
return String(obj);<br />
} else {<br />
// recurse array or object<br />
var n, v, json = [], arr = (obj &amp;&amp; obj.constructor == Array);<br />
for (n in obj) {<br />
v = obj[n];<br />
t = typeof (v);<br />
if (t == "string")<br />
v = '"' + v + '"';<br />
else if (t == "object" &amp;&amp; v !== null)<br />
v = JSON.stringify(v);<br />
json.push((arr ? "" : '"' + n + '":') + String(v));<br />
}<br />
return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");<br />
}<br />
};<br />
// implement JSON.parse de-serialization<br />
JSON.parse = JSON.parse || function() {<br />
var r = "(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)", k = '(?:[^\-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))';<br />
k = '(?:"' + k + '*")';<br />
var s = new RegExp(<br />
"(?:false|true|null|[\\{\\}\\[\\]]|" + r + "|" + k + ")", "g"), t = new RegExp(<br />
"\\\\(?:([^u])|u(.{4}))", "g"), u = {<br />
'"' : '"',<br />
"/" : "/",<br />
"\\" : "\\",<br />
b : "\u0008",<br />
f : "\u000c",<br />
n : "\n",<br />
r : "\r",<br />
t : "\t"<br />
};<br />
function v(h, j, e) {<br />
return j ? u[j] : String.fromCharCode(parseInt(e, 16));<br />
}<br />
var w = new String(""), x = Object.hasOwnProperty;<br />
return function(h, j) {<br />
h = h.match(s);<br />
var e, c = h[0], l = false;<br />
if ("{" === c)<br />
e = {};<br />
else if ("[" === c)<br />
e = [];<br />
else {<br />
e = [];<br />
l = true;<br />
}<br />
for ( var b, d = [ e ], m = 1 - l, y = h.length; m = 0;)<br />
delete f[i[g]];<br />
}<br />
return j.call(n, o, f);<br />
};<br />
e = p({<br />
"" : e<br />
}, "");<br />
}<br />
return e;<br />
};<br />
}();</code></p>
<p>&nbsp;<br />
You can refer to this link for more : https://github.com/douglascrockford/JSON-js</p>
<p>&nbsp;</p>
<p><strong><span style="color:#33cccc;"><em>This posting is provided “AS IS” with no warranties, and confers no rights.</em></span></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=110&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/09/22/json-undefined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP .Net MVC &#8211; Yes or No</title>
		<link>http://anubhavg.wordpress.com/2011/09/20/asp-net-mvc-yes-or-no/</link>
		<comments>http://anubhavg.wordpress.com/2011/09/20/asp-net-mvc-yes-or-no/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 23:05:33 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[asp .net]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=106</guid>
		<description><![CDATA[Finally got a chance to work on a MVC 3.0 project. Still not convinced if MVC is best choice for asp application development. I found this on net which explains how to decide to go for MVC or not when starting your application development using ASP .Net. Its a simple analyser that can be a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=106&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Finally got a chance to work on a MVC 3.0 project. Still not convinced if MVC is best choice for asp application development. I found this on net which explains how to decide to go for MVC or not when starting your application development using ASP .Net. Its a simple analyser that can be a great help when in doubt.</p>
<p>Hope it helps.</p>
<div id="attachment_107" class="wp-caption aligncenter" style="width: 232px"><a href="http://anubhavg.files.wordpress.com/2011/09/mvcdecider.png"><img class="size-medium wp-image-107" title="MVCDecider." src="http://anubhavg.files.wordpress.com/2011/09/mvcdecider.png?w=222&#038;h=300" alt="MVC or Web form" width="222" height="300" /></a><p class="wp-caption-text">MVC or Web form</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=106&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2011/09/20/asp-net-mvc-yes-or-no/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>

		<media:content url="http://anubhavg.files.wordpress.com/2011/09/mvcdecider.png?w=222" medium="image">
			<media:title type="html">MVCDecider.</media:title>
		</media:content>
	</item>
		<item>
		<title>How to put comments in .skin files</title>
		<link>http://anubhavg.wordpress.com/2010/05/01/how-to-put-comments-in-skin-files/</link>
		<comments>http://anubhavg.wordpress.com/2010/05/01/how-to-put-comments-in-skin-files/#comments</comments>
		<pubDate>Sat, 01 May 2010 10:48:49 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[asp .net]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/2010/05/01/how-to-put-comments-in-skin-files/</guid>
		<description><![CDATA[Skin files, introduced in ASP.NET 2.0, make it easier to specify an application&#8217;s look and feel. Commercial developers will want to add a comment with their copyright notice, but Microsoft does not explain how to put a comment in a skin file. In his book &#8220;Programming ASP.NET 2.0 Core Reference,&#8221; Dino Esposito shows skin file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=101&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Skin files, introduced in ASP.NET 2.0, make it easier to specify an application&#8217;s look and feel. Commercial developers will want to add a comment with their copyright notice, but Microsoft does not explain how to put a comment in a skin file. In his book &#8220;Programming ASP.NET 2.0 Core Reference,&#8221; Dino Esposito shows skin file content with an HTML comment, but that will cause a build failure in the release version of Visual Studio 2005.</p>
<p>Although a skin file looks like .aspx markup, it is highly restricted. However, it does recognize ASP code blocks and will accept code block comments, such as this example:</p>
<p>&lt; % &#8211; - Copyright 2006 XYZ Corp. All rights reserved. &#8211; - % &gt;</p>
<p>[Note: because of display limitations, characters "" here are shown with a space after or before them.]</p>
<p>&#8211; copied from http://aspnet2holes.blogspot.com/2006/06/comments-in-skin-file.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=101&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2010/05/01/how-to-put-comments-in-skin-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>TFS Build Agent Unreachable</title>
		<link>http://anubhavg.wordpress.com/2010/03/24/tfs-build-agent-unreachable/</link>
		<comments>http://anubhavg.wordpress.com/2010/03/24/tfs-build-agent-unreachable/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 01:31:20 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=98</guid>
		<description><![CDATA[Today when I kicked off a TFS build I got an error: TF215085: An error occurred while connecting to agent \#####\##BuildAgent: TF215076: Team Foundation Build on computer wd201a013v (port 9191) is not responding. (Detail Message: Unable to connect to the remote server). The steps I took to resolve it. 1. Check if 9191 is added [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=98&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today when I kicked off a TFS build I got an error:</p>
<p>TF215085: An error occurred while connecting to agent \#####\##BuildAgent: TF215076: Team Foundation Build on computer wd201a013v (port 9191) is not responding. (Detail Message: Unable to connect to the remote server).</p>
<p>The steps I took to resolve it.</p>
<p>1. Check if 9191 is added in the windows firewall exception list on the build machine. Control Panel &gt; Windows Firewall. If not add an explicit rule to allow the port (9191 is default)</p>
<p>2. Check if Visual Studio Team Foundation Build service is running. Run &gt; Services.msc &gt; locate service if it running. If not start it. Visual Studio Team Foundation Build is the build service for Visual Studio Team Foundation 2008. If the service doesn&#8217;t start check the logon credentials. Make sure it is a valid Domain account or Workgroup account.</p>
<p>Problem Solved.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=98&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2010/03/24/tfs-build-agent-unreachable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
		<item>
		<title>Pragma no-cache</title>
		<link>http://anubhavg.wordpress.com/2010/03/19/pragma-no-cache/</link>
		<comments>http://anubhavg.wordpress.com/2010/03/19/pragma-no-cache/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 03:40:39 +0000</pubDate>
		<dc:creator>Anubhav Goyal</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://anubhavg.wordpress.com/?p=96</guid>
		<description><![CDATA[I had a requirement where an aspx page should not be cached in the Temporary Internet Files, simply because we want to reload the page from the server each time. This sort of scenario may present when login or authenticating. Some research and I found this article http://support.microsoft.com/kb/222064. I was writing code in .Net and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=96&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a requirement where an aspx page should not be cached in the Temporary Internet Files, simply because we want to reload the page from the server each time. This sort of scenario may present when login or authenticating. Some research and I found this article <a href="http://support.microsoft.com/kb/222064">http://support.microsoft.com/kb/222064</a>.</p>
<p>I was writing code in .Net and luckily its even simpler. Simply add this to the Page_Load</p>
<p>Response.Cache.SetCacheability(HttpCacheability.NoCache);<br />
 Response.AddHeader(&#8220;Pragma&#8221;, &#8220;no-cache&#8221;);</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anubhavg.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anubhavg.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anubhavg.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anubhavg.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anubhavg.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anubhavg.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anubhavg.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anubhavg.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=anubhavg.wordpress.com&amp;blog=1762946&amp;post=96&amp;subd=anubhavg&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://anubhavg.wordpress.com/2010/03/19/pragma-no-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a07891ddf65a4071fd3793b50afae1ce?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Anubhav Goyal</media:title>
		</media:content>
	</item>
	</channel>
</rss>
