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

<channel>
	<title>Rajeesh&#039;s Blog &#187; ASP.NET</title>
	<atom:link href="http://www.rajeeshcv.com/category/net/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rajeeshcv.com</link>
	<description>Sharing my knowledge</description>
	<lastBuildDate>Sun, 18 Jul 2010 06:09:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Logging execution time using AOP</title>
		<link>http://www.rajeeshcv.com/2010/02/logging-execution-time-using-aop/</link>
		<comments>http://www.rajeeshcv.com/2010/02/logging-execution-time-using-aop/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 18:27:00 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[Profiling]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/?p=155</guid>
		<description><![CDATA[Download the source code for this tutorial from&#160; &#8211; http://www.rajeeshcv.com/download/ProfilingSample.zip
What happens if your client complains that your application is running very slow!!! or in your load/stress testing you found that some functionalities are very slow in executing than expected. This is the time where you go for profiling the execution, to analyse the root cause [...]]]></description>
			<content:encoded><![CDATA[<p><em>Download the source code for this tutorial from&#160; &#8211; </em><a title="http://www.rajeeshcv.com/download/ProfilingSample.zip" href="http://www.rajeeshcv.com/download/ProfilingSample.zip"><em>http://www.rajeeshcv.com/download/ProfilingSample.zip</em></a></p>
<p>What happens if your client complains that your application is running very slow!!! or in your load/stress testing you found that some functionalities are very slow in executing than expected. This is the time where you go for profiling the execution, to analyse the root cause of these issues.</p>
<p>So how we could develop a profiler, where we don’t have to wrap our normal code in a profiling code.</p>
<p>Before going to create the profiler, we have to decide where to put the profiled information. In this tutorial, I am making use of <a href="http://logging.apache.org/log4net/" target="_blank">Log4Net</a> as underlying layer to store this information. If you have not used <a href="http://logging.apache.org/log4net/" target="_blank">Log4Net</a> before, I suggest you to read <a href="http://www.beefycode.com/post/Log4Net-Tutorial-pt-1-Getting-Started.aspx">http://www.beefycode.com/post/Log4Net-Tutorial-pt-1-Getting-Started.aspx</a> as a starting point.</p>
<p>With the help of AOP (Aspect-Oriented Programming) we could do the profiling task without interrupting the actual code.</p>
<blockquote><p>AOP is a programming paradigm in which secondary or supporting functions are isolated from the main program&#8217;s business logic </p>
<p>Source : Wikipedia</p>
</blockquote>
<p>So in order bring the AOP functionality into this application, I am going to use a third party library <a href="http://www.sharpcrafters.com/" target="_blank">PostSharp</a>&#160; which I believe this is one of the best that is available in the market. Please download it from <a title="http://www.sharpcrafters.com/postsharp/download" href="http://www.sharpcrafters.com/postsharp/download">http://www.sharpcrafters.com/postsharp/download</a>.</p>
<p>So, now we have got the basic things to start with and now let’s start coding….</p>
<p>Start a new solution in visual studio and add a new console application project to it. Then add the below references to the newly created project</p>
<ol>
<li>Add reference to the Log4Net.dll </li>
<li>Add reference to PostSharp.Laos.dll and PostSharp.Public.dll (Please read <a href="http://www.sharpcrafters.com/postsharp/documentation/getting-started">http://www.sharpcrafters.com/postsharp/documentation/getting-started</a> to get the basic installation procedure) </li>
</ol>
<p>Next, create a new attribute class called “ProfileMethodAttribute” – this class is responsible for doing the profiling work. Make sure that you have decorated this class with “Serializable” attribute</p>
<p> <span id="more-155"></span>
</p>
<pre class="brush: csharp;">[Serializable]
public class ProfileMethodAttribute : OnMethodBoundaryAspect
{

    public override void OnEntry(MethodExecutionEventArgs eventArgs)
    {
        ........
    }

    public override void OnExit(MethodExecutionEventArgs eventArgs)
    {
       ......
    }
}</pre>
<p>This class actually derives from “OnMethodBoundaryAspect”,&#160; it has got two methods “OnEntry” and “OnExit” which we needed. These method will be called before the start of a method execution and at the end of method execution respectively, when this attribute is decorated against a method.</p>
<p>When a call comes to “OnEntry” method, we will first log the execution call using the LoggerHelper, then start a clock using another helper class “Profiler”</p>
<pre class="brush: csharp;">public class LoggerHelper
{
    /// &lt;summary&gt;
    /// Static instance of ILogger.
    /// &lt;/summary&gt;
    private static ILog logger;

    /// &lt;summary&gt;
    /// Initializes static members of the &lt;see cref=&quot;LoggerHelper&quot;/&gt; class.
    /// &lt;/summary&gt;
    static LoggerHelper()
    {
        log4net.Config.XmlConfigurator.Configure();
        logger = LogManager.GetLogger(typeof(Program));
    }

    /// &lt;summary&gt;
    /// Logs the specified message.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;message&quot;&gt;The message.&lt;/param&gt;
    public static void Log(string message)
    {
        string enableProfiling = ConfigurationManager.AppSettings[&quot;EnableProfiling&quot;];
        if (string.IsNullOrEmpty(enableProfiling) || enableProfiling.ToLowerInvariant() == &quot;true&quot;)
        {
            logger.Debug(message);
        }
    }

    /// &lt;summary&gt;
    /// Logs the specified method name.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;methodName&quot;&gt;Name of the method.&lt;/param&gt;
    /// &lt;param name=&quot;url&quot;&gt;The URL to log.&lt;/param&gt;
    /// &lt;param name=&quot;executionFlowMessage&quot;&gt;The execution flow message.&lt;/param&gt;
    /// &lt;param name=&quot;actualMessage&quot;&gt;The actual message.&lt;/param&gt;
    public static void Log(string methodName, string url, string executionFlowMessage, string actualMessage)
    {
        Log(ConstructLog(methodName, url, executionFlowMessage, actualMessage));
    }

    /// &lt;summary&gt;
    /// Logs the specified method name.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;methodName&quot;&gt;Name of the method.&lt;/param&gt;
    /// &lt;param name=&quot;url&quot;&gt;The URL to log.&lt;/param&gt;
    /// &lt;param name=&quot;executionFlowMessage&quot;&gt;The execution flow message.&lt;/param&gt;
    /// &lt;param name=&quot;actualMessage&quot;&gt;The actual message.&lt;/param&gt;
    /// &lt;param name=&quot;executionTime&quot;&gt;The execution time.&lt;/param&gt;
    public static void Log(string methodName, string url, string executionFlowMessage, string actualMessage, int executionTime)
    {
        Log(ConstructLog(methodName, url, executionFlowMessage, actualMessage, executionTime));
    }

    /// &lt;summary&gt;
    /// Constructs the log.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;methodName&quot;&gt;Name of the method.&lt;/param&gt;
    /// &lt;param name=&quot;url&quot;&gt;The URL to be logged.&lt;/param&gt;
    /// &lt;param name=&quot;executionFlowMessage&quot;&gt;The execution flow message.&lt;/param&gt;
    /// &lt;param name=&quot;actualMessage&quot;&gt;The actual message.&lt;/param&gt;
    /// &lt;returns&gt;Formatted string.&lt;/returns&gt;
    private static string ConstructLog(string methodName, string url, string executionFlowMessage, string actualMessage)
    {
        var sb = new StringBuilder();

        if (!string.IsNullOrEmpty(methodName))
        {
            sb.AppendFormat(&quot;MethodName : {0}, &quot;, methodName);
        }

        if (!string.IsNullOrEmpty(url))
        {
            sb.AppendFormat(&quot;Url : {0}, &quot;, url);
        }

        if (!string.IsNullOrEmpty(executionFlowMessage))
        {
            sb.AppendFormat(&quot;ExecutionFlowMessage : {0}, &quot;, executionFlowMessage);
        }

        if (!string.IsNullOrEmpty(actualMessage))
        {
            sb.AppendFormat(&quot;ActualMessage : {0}, &quot;, actualMessage);
        }

        string message = sb.ToString();

        message = message.Remove(message.Length - 2);

        return message;
    }

    /// &lt;summary&gt;
    /// Constructs the log.
    /// &lt;/summary&gt;
    /// &lt;param name=&quot;methodName&quot;&gt;Name of the method.&lt;/param&gt;
    /// &lt;param name=&quot;url&quot;&gt;The URL to be logged.&lt;/param&gt;
    /// &lt;param name=&quot;executionFlowMessage&quot;&gt;The execution flow message.&lt;/param&gt;
    /// &lt;param name=&quot;actualMessage&quot;&gt;The actual message.&lt;/param&gt;
    /// &lt;param name=&quot;executionTime&quot;&gt;The execution time.&lt;/param&gt;
    /// &lt;returns&gt;Formatted string.&lt;/returns&gt;
    private static string ConstructLog(string methodName, string url, string executionFlowMessage, string actualMessage, int executionTime)
    {
        var sb = new StringBuilder();

        sb.Append(ConstructLog(methodName, url, executionFlowMessage, actualMessage));
        sb.AppendFormat(&quot;, ExecutionTime : {0}&quot;, executionTime);

        return sb.ToString();
    }
}</pre>
<p>LoggerHelper is a just uses the Log4Net objects to log the message to configured location.</p>
<p>The “Profiler” class</p>
<pre class="brush: csharp;">/// &lt;summary&gt;
/// Helper class that wraps the timer based functionalities.
/// &lt;/summary&gt;
internal static class Profiler
{
    /// &lt;summary&gt;
    /// Lock object.
    /// &lt;/summary&gt;
    private static readonly object SyncLock = new object();

    /// &lt;summary&gt;
    /// Variable that tracks the time.
    /// &lt;/summary&gt;
    private static readonly Dictionary&lt;int, Stack&lt;long&gt;&gt; ProfilePool;

    /// &lt;summary&gt;
    /// Initializes static members of the &lt;see cref=&quot;Profiler&quot;/&gt; class.
    /// &lt;/summary&gt;
    static Profiler()
    {
        ProfilePool = new Dictionary&lt;int, Stack&lt;long&gt;&gt;();
    }

    /// &lt;summary&gt;
    /// Starts this timer.
    /// &lt;/summary&gt;
    public static void Start()
    {
        lock (SyncLock)
        {
            int currentThreadId = Thread.CurrentThread.ManagedThreadId;
            if (ProfilePool.ContainsKey(currentThreadId))
            {
                ProfilePool[currentThreadId].Push( Environment.TickCount );
            }
            else
            {
                var timerStack = new Stack&lt;long&gt;();
                timerStack.Push(DateTime.UtcNow.Ticks);
                ProfilePool.Add(currentThreadId, timerStack);
            }
        }
    }

    /// &lt;summary&gt;
    /// Stops timer and calculate the execution time.
    /// &lt;/summary&gt;
    /// &lt;returns&gt;Execution time in milli seconds&lt;/returns&gt;
    public static int Stop()
    {
        lock (SyncLock)
        {
            long currentTicks = DateTime.UtcNow.Ticks;
            int currentThreadId = Thread.CurrentThread.ManagedThreadId;

            if (ProfilePool.ContainsKey(currentThreadId))
            {
                long ticks = ProfilePool[currentThreadId].Pop();
                if (ProfilePool[currentThreadId].Count == 0)
                {
                    ProfilePool.Remove(currentThreadId);
                }

                var timeSpan = new TimeSpan(currentTicks - ticks);

                return (int)timeSpan.TotalMilliseconds;
            }
        }

        return 0;
    }
}</pre>
<p>which stores the starting tick and calculate the time taken to execute when “Stop” is called.</p>
<p>Below is code snippet from “OnEntry” method</p>
<pre class="brush: csharp;">public override void OnEntry(MethodExecutionEventArgs eventArgs)
{
    this._methodName = this.ExcludeMethodName ? string.Empty : eventArgs.Method.Name;
    this._url = this.IncludeUrl ? string.Empty : (HttpContext.Current == null) ? string.Empty : HttpContext.Current.Request.Url.ToString();

    LoggerHelper.Log(this._methodName, this._url, this.EntryMessage, this.Message);
    Profiler.Start();
}</pre>
<p>And OnExist, is almost similar expect there we will stop the profile timer.</p>
<pre class="brush: csharp;">public override void OnExit(MethodExecutionEventArgs eventArgs)
{
    int count = Profiler.Stop();
    LoggerHelper.Log(this._methodName, this._url, this.EntryMessage, this.Message, count);
}</pre>
<p>I haven’t explained each line of the code,&#160; so please find the attached sample(<a title="http://www.rajeeshcv.com/download/ProfilingSample.zip" href="http://www.rajeeshcv.com/download/ProfilingSample.zip">http://www.rajeeshcv.com/download/ProfilingSample.zip</a>) for all of these source codes.</p>
<p>Next step is to use this and see whether it is logged properly.</p>
<p>In order enable profiling for a method, you just needs to decorate it with the “ProfileMethod” attribute. Like below</p>
<pre class="brush: csharp;">[ProfileMethod()]
public void SimpleMethod()
{
    Thread.Sleep(5000);
}</pre>
<p>Then if you run the application and somebody calls this above method, a log entry will be created where you have configured.</p>
<p>The out of that log file will be something like below</p>
<p>PROFILING 2010-02-26 00:19:59,838 [1] Log MethodName : SimpleMethod<br />
  <br />PROFILING 2010-02-26 00:20:04,865 [1] Log MethodName : SimpleMethod, ExecutionTime : 5002</p>
<p>Please least me know, if this helped you.</p>
<p><em>Download the source code for this tutorial from&#160; &#8211; </em><a title="http://www.rajeeshcv.com/download/ProfilingSample.zip" href="http://www.rajeeshcv.com/download/ProfilingSample.zip"><em>http://www.rajeeshcv.com/download/ProfilingSample.zip</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2010/02/logging-execution-time-using-aop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC &#8211; Conditional rendering Partial Views with Action&lt;T&gt; delegate</title>
		<link>http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views-with-actiont-delegate/</link>
		<comments>http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views-with-actiont-delegate/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 02:23:40 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[HTML Extension]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views-with-actiont-delegate/</guid>
		<description><![CDATA[This is an update to my previous post regarding conditional rendering partial views, in that I used the internal implementation of the Html.RenderPartail(…) method to create the Html extension. Later I found a simple way to achieve the same using Action&#60;T&#62; delegate
&#60;p&#62;Partial rendering with Action Methods&#60;/p&#62;
&#60;% Html.PartialIf(this.Model.Exists, html =&#62; html.RenderPartial(&#34;MyPartialView&#34;)); %&#62;
If you look at the [...]]]></description>
			<content:encoded><![CDATA[<p>This is an update to my previous <a href="http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views/" target="_blank">post</a> regarding conditional rendering partial views, in that I used the internal implementation of the Html.RenderPartail(…) method to create the Html extension. Later I found a simple way to achieve the same using Action&lt;T&gt; delegate</p>
<pre class="brush: xml;">&lt;p&gt;Partial rendering with Action Methods&lt;/p&gt;
&lt;% Html.PartialIf(this.Model.Exists, html =&gt; html.RenderPartial(&quot;MyPartialView&quot;)); %&gt;</pre>
<p>If you look at the “PartialIf” implementation, it is simple, cleaner than the previous technique I have mentioned in my <a href="http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views/" target="_blank">post</a>.</p>
<pre class="brush: csharp;">public static void PartialIf(this HtmlHelper htmlHelper, bool condition, Action&lt;HtmlHelper&gt; action)
{
    if (condition)
    {
        action.Invoke(htmlHelper);
    }
}</pre>
<p>That’s it <img src='http://www.rajeeshcv.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views-with-actiont-delegate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC &#8211; Conditional rendering Partial Views</title>
		<link>http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views/</link>
		<comments>http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 01:43:42 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views/</guid>
		<description><![CDATA[

Update : Later I found a cleaner and simple approach to do the same – read this post ASP.Net MVC – Conditional rendering Partial Views with Action&#60;T&#62; delegate

Following my previous post about Conditional Rendering, one of my colleague asked me how to render the partial view based on a condition. 
Normal way of doing this [...]]]></description>
			<content:encoded><![CDATA[<p><br />
<blockquote>
<p>Update : Later I found a cleaner and simple approach to do the same – read this post <a href="http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views-with-actiont-delegate/" target="_blank">ASP.Net MVC – Conditional rendering Partial Views with Action&lt;T&gt; delegate</a></p>
</blockquote>
<p>Following my previous post about <a href="http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering/" target="_blank">Conditional Rendering</a>, one of my colleague asked me how to render the partial view based on a condition. </p>
<p>Normal way of doing this is </p>
<pre class="brush: xml;">&lt;p&gt;Normal partial rendering based on condition&lt;/p&gt;
&lt;% if(this.Model.Exists)
 {
     Html.RenderPartial(&quot;MyPartialView&quot;);
 } %&gt;</pre>
<p>I am not sure about any other technique for rendering partial view conditionally other than this (correct me if I am wrong <img src='http://www.rajeeshcv.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>Then I thought about copying the pattern I have used in my <a href="http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering/" target="_blank">previous post</a> and came up with this code which could conditionally render partial views and you could use the Html extension like below, which more clean than the previous</p>
<pre class="brush: xml;">&lt;% Html.PartialIf(this.Model.Exists, &quot;MyPartialView&quot;); %&gt;</pre>
</p>
<p><span id="more-135"></span></p>
<p>Below is the Html extension I have created</p>
<pre class="brush: csharp;">public static void PartialIf(this HtmlHelper htmlHelper, bool condition, string viewName)
       {
           if (condition)
           {
               RenderPartialInternal(
                   htmlHelper.ViewContext,
                   htmlHelper.ViewDataContainer,
                   viewName,
                   htmlHelper.ViewData,
                   null,
                   ViewEngines.Engines);
           }
       }

public static void PartialIf(this HtmlHelper htmlHelper, bool condition, string viewName, ViewDataDictionary viewData)
       {
           if (condition)
           {
               RenderPartialInternal(
                   htmlHelper.ViewContext,
                   htmlHelper.ViewDataContainer,
                   viewName,
                   viewData,
                   null,
                   ViewEngines.Engines);
           }
       }

public static void PartialIf(this HtmlHelper htmlHelper, bool condition, string viewName, object model)
       {
           if (condition)
           {
               RenderPartialInternal(
                   htmlHelper.ViewContext,
                   htmlHelper.ViewDataContainer,
                   viewName,
                   htmlHelper.ViewData,
                   model,
                   ViewEngines.Engines);
           }
       }

public static void PartialIf(this HtmlHelper htmlHelper, bool condition, string viewName, object model, ViewDataDictionary viewData)
       {
           if (condition)
           {
               RenderPartialInternal(
                   htmlHelper.ViewContext,
                   htmlHelper.ViewDataContainer,
                   viewName,
                   viewData,
                   model,
                   ViewEngines.Engines);
           }
       }</pre>
<p>And here is the helper method I have used in the about extension ( most of the code snippet is taken from the MVC method Html.Renderpartial(…), thanks to open source )</p>
<pre class="brush: csharp;">internal static IView FindPartialView(ViewContext viewContext, string partialViewName, ViewEngineCollection viewEngineCollection)
{
    var result = viewEngineCollection.FindPartialView(viewContext, partialViewName);
    if (result != null)
    {
        if (result.View != null)
        {
            return result.View;
        }
    }

    throw new InvalidOperationException(&quot;Partial view not found&quot;);
}

internal static void RenderPartialInternal(ViewContext viewContext, IViewDataContainer viewDataContainer, string partialViewName, ViewDataDictionary viewData, object model, ViewEngineCollection viewEngineCollection)
{
    if (String.IsNullOrEmpty(partialViewName))
    {
        throw new ArgumentException(&quot;PartialViewName can't be empty or null.&quot;);
    }

    ViewDataDictionary newViewData = null;

    if (model == null)
    {
        newViewData = viewData == null ? new ViewDataDictionary(viewDataContainer.ViewData) : new ViewDataDictionary(viewData);
    }
    else
    {
        newViewData = viewData == null ? new ViewDataDictionary(model) : new ViewDataDictionary(viewData) { Model = model };
    }

    var newViewContext = new ViewContext(viewContext, viewContext.View, newViewData, viewContext.TempData);
    var view = FindPartialView(newViewContext, partialViewName, viewEngineCollection);
    view.Render(newViewContext, viewContext.HttpContext.Response.Output);
}</pre>
<p>&#160;</p>
<p>Hope this helps</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2010/01/asp-net-mvc-conditional-rendering-partial-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comet a.k.a server pushing</title>
		<link>http://www.rajeeshcv.com/2009/12/comet-aka-server-pushing/</link>
		<comments>http://www.rajeeshcv.com/2009/12/comet-aka-server-pushing/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 18:14:47 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2009/12/comet-aka-server-pushing/</guid>
		<description><![CDATA[Have you ever thought about how chatting in Gmail works? I think it works using a programming technique called “Comet”.
What is comet programming

In web development, Comet is a neologism to describe a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever thought about how chatting in Gmail works? I think it works using a programming technique called “Comet”.
<p>What is comet programming<br />
<blockquote>
<p>In web development, <b>Comet</b> is a neologism to describe a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term for multiple techniques for achieving this interaction. All these methods rely on features included by default in browsers, such as JavaScript, rather than on non-default plugins &#8211; – <strong>Wikipedia</strong></p>
</blockquote>
<p>Last few days, I was reading about this technology and thought about sharing the information with you all. Please find the attached sample application which demonstrates how comet works using Asp.Net (<b><i>Note:</i></b><i> Right now it works only in firefox, fixes or patches to make it work in IE/Safari.. or all the browsers in this world are welcome</i> J )
<p>Please download it from here &#8211; <a title="http://www.rajeeshcv.com/download/comet.zip" href="http://www.rajeeshcv.com/download/comet.zip">http://www.rajeeshcv.com/download/comet.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2009/12/comet-aka-server-pushing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET AJAX &#8211; Passing JSON object from client to server</title>
		<link>http://www.rajeeshcv.com/2008/10/aspnet-ajax-passing-json-object-from-client-to-server/</link>
		<comments>http://www.rajeeshcv.com/2008/10/aspnet-ajax-passing-json-object-from-client-to-server/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 18:39:15 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2008/10/aspnet-ajax-passing-json-object-from-client-to-server/</guid>
		<description><![CDATA[Passing JSON object from client to server]]></description>
			<content:encoded><![CDATA[<ol>
<li><a title="calling server side methods from client side" href="http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/" target="_blank">Part 1- Calling server side methods from client side</a> </li>
</ol>
<p>Read the Part 1 of this tutorial if you don&#8217;t know how to call server side methods directly from client side.</p>
<p>In this post, I will explain how to pass data from client to server in JSON format.</p>
<p>Microsoft AJAX client library has built-in methods which helps in serializing and de-serializing JSON. The methods are defined in &quot;<strong>Sys.Serialization.JavaScriptSerializer</strong>&quot; class. In server side we have &quot;<strong>JavaScriptSerializer</strong>&quot;that will help you out to do the JSON serialization and de-serialization.</p>
<p><span id="more-78"></span></p>
<p>With the help of these two classes, we can easily do the data transfer. Suppose you have class called <strong>&quot;Customer&quot;</strong> in server side, which looks like this</p>
<pre class="c-sharp" name="code">
using System;

namespace ServerClientInteration
{
    [Serializable]
    public class Customer
    {
        public int ID { get; set; }

        public string Name { get; set; }

        public string Address { get; set; }
    }
}</pre>
<p>This is our payload for this example, we are going to move this object from server to client and vice versa. For that I have exposed two static methods on the server side; one is for retrieving the customer details and the other is for updating the customer.</p>
<pre class="c-sharp" name="code">
  public partial class _Default : System.Web.UI.Page
    {
        private static Customer customer = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (customer == null)
            {
                customer = new Customer();
                customer.ID = 1;
                customer.Name = &quot;microsoft&quot;;
                customer.Address = &quot;www.microsoft.com&quot;;
            }

        }

        [WebMethod]
        [ScriptMethod(UseHttpGet=true)]
        public static string GetTime()
        {
            return DateTime.Now.ToLongTimeString();
        }

        [WebMethod]
        [ScriptMethod(UseHttpGet = true)]
        public static string GetCustomer()
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            return serializer.Serialize(customer);
        }

        [WebMethod]
        [ScriptMethod]
        public static string UpdateCustomer(string jsonCustomer)
        {
            try
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                Customer cust = serializer.Deserialize<customer>(jsonCustomer);
                customer.ID = cust.ID;
                customer.Name = cust.Name;
                customer.Address = cust.Address;

                return &quot;Updated&quot;;
            }
            catch(Exception Exception)
            {

            }

            return &quot;Error occured while updating&quot;;
        }
    }</pre>
<p>In the above code, you can see &quot;<strong>GetCustomer</strong>&quot; and &quot;<strong>UpdateCustomer</strong>&quot; methods. &quot;<strong>GetCustomer</strong>&quot; will serialize the static customer object and return it as JSON string; &quot;<strong>UpdateCustomer</strong>&quot; method accepts JSON string as input and that string is de-serialized in to a customer object and the static customer variable is updated with the new values. &quot;<strong>UpdateCustomer</strong>&quot; will return status message after the update.</p>
<p>Usually, we persist the customer in DB or some other states, but here for simplicity I have used a static variable which will simulate the persistence.</p>
<p>Now we need to call this from the client-side, for that I have two hyperlinks; one will get the customer from the server and other send the customer to the server.</p>
<p>Here is how the HTML looks like</p>
<pre class="html" name="code">
&lt;head runat=&quot;server&quot;&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt; 

#result
{
width: 250px;
height: 300px;
overflow: auto;
border:1px solid #00d;
} 

&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
&lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot; EnablePageMethods=&quot;true&quot;&gt;
&lt;/asp:ScriptManager&gt;
&lt;div&gt;
&lt;a href=&quot;javascript:callServerMethod()&quot; &gt;Call Server method&lt;/a&gt;
&lt;hr /&gt;
&lt;a href=&quot;javascript:getCustomer()&quot; &gt;Get Customer&lt;/a&gt;
&lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;div&gt;
ID : &lt;input type=&quot;text&quot; id=&quot;custID&quot; /&gt;&lt;br /&gt;
Name : &lt;input type=&quot;text&quot; id=&quot;custName&quot; /&gt;&lt;br /&gt;
Adress : &lt;input type=&quot;text&quot; id=&quot;custAdd&quot; /&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;a href=&quot;javascript:updateCustomer()&quot; &gt;Update customer&lt;/a&gt;&lt;br /&gt; 

&lt;/div&gt;
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[ 

function callServerMethod()
{
PageMethods.GetTime(callBackMethod);
} 

function callBackMethod(result)
{
alert(result);
} 

function getCustomer()
{
PageMethods.GetCustomer(callBackGetCustomer);
} 

function callBackGetCustomer(result)
{
var customer = Sys.Serialization.JavaScriptSerializer.deserialize(result);
var content = &quot;&lt;br /&gt;ID :&quot; +  customer.ID + &quot;&lt;br /&gt;&quot; + &quot;Name : &quot; + customer.Name + &quot;&lt;br /&gt;&quot; + &quot;Address : &quot; + customer.Address;
$get(&quot;result&quot;).innerHTML += content;
} 

var clientCustomer = function(id,name,add){
this.ID = id;
this.Name = name;
this.Address = add;
}; 

function updateCustomer()
{
var id = $get(&quot;custID&quot;).value;
var name = $get(&quot;custName&quot;).value;
var address = $get(&quot;custAdd&quot;).value; 

var customer = new clientCustomer(id,name,address);
var serializedCustomer = Sys.Serialization.JavaScriptSerializer.serialize(customer);
PageMethods.UpdateCustomer(serializedCustomer,callBackUpdateCustomer);
} 

function callBackUpdateCustomer(result)
{
alert(result);
} 

//]]&gt;
&lt;/script&gt;
&lt;/form&gt;
&lt;/body&gt;</pre>
<p>I think the above code is self explanatory, let me know if you have any difficulty in understanding this.</p>
<p>Hope this will gave some idea about passing JSON between client and server. I have uploaded the source code in my server and you can get it from here &#8211; <a href="http://www.rajeeshcv.com/download/ServerClientInteration.zip">http://www.rajeeshcv.com/download/ServerClientInteration.zip</a></p>
<div class="wlWriterSmartContent" id="scid:C16BAC14-9A3D-4c50-9394-FBFEF7A93539:bd873e8b-d1f1-463c-a8ed-d3c0733e6590" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"><a href="http://www.dotnetkicks.com/kick/?url=http://www.rajeeshcv.com/2008/10/aspnet-ajax-passing-json-object-from-client-to-server/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.rajeeshcv.com/2008/10/aspnet-ajax-passing-json-object-from-client-to-server/" border="0" alt="kick it on DotNetKicks.com" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/10/aspnet-ajax-passing-json-object-from-client-to-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>ASP.NET AJAX &#8211; Calling server side methods from client side</title>
		<link>http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/</link>
		<comments>http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 19:13:52 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/</guid>
		<description><![CDATA[Calling server side methods from client side - an asp.net AJAX technique]]></description>
			<content:encoded><![CDATA[<p>ASP.net AJAX has got nice bridging between your server side and client side technologies. Using the ASP.net AJAX you can easily call a method in a page. The restriction here is that, the methods your are trying to call should be static and public.</p>
<p>This feature(calling server side static method) is not enabled by default, so you have to manually enable this and it is very very simple; just set the &quot;<strong>EnablePageMethods</strong>&quot; property of the &quot;<strong>ScriptManager</strong>&quot; to <strong>true</strong> like this</p>
<p><span id="more-77"></span></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<pre class="html" name="code">&lt;asp:scriptmanager id=&quot;ScriptManager1&quot; runat=&quot;server&quot; enablepagemethods=&quot;true&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;/asp:scriptmanager&gt;</pre>
</p>
<p>After this, create a public static method in your asp.net page and decorate it with WebMethod(System.Web.Services.dll) and ScriptMethod(System.Web.Extensions.dll) attributes. For example I have created a static method called &quot;<strong>GetTime()</strong>&quot; which returns current time as string.</p>
</p>
<pre class="c-sharp" name="code">
public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod]
        [ScriptMethod]
        public static string GetTime()
        {
            return DateTime.Now.ToLongTimeString();
        }
    }  </pre>
</p>
<p>Now you have configured everything correctly and I will show you how to call this method from the client side.</p>
<p>Earlier you have set the &quot;<strong>EnablePageMethods</strong>&quot; property of &quot;<strong>ScriptManager</strong>&quot; to <strong>true</strong>, as a result of that a new object called &quot;<strong>PageMethods</strong>&quot; is created by the <strong>ScriptManager</strong> when the page is rendered. This object has all the public static methods in that page. So that you call the server side method like <strong>PageMethods.[ServerSideMethodName]</strong>. When calling this methods from client side you have to provide a callback function because here all the call scriptmanager made will be asynchronous, and this callback method will get the returned result.</p>
<p>Below is the sample code </p>
</p>
<pre class="javascript" name="code">
	function callServerMethod()
        {
            PageMethods.GetTime(callBackMethod);
        }

        function callBackMethod(result)
        {
            alert(result);
        }</pre>
<p>Complete aspx page looks like this </p>
<pre class="html" name="code">
&lt;body&gt;&#160;&#160;&#160;&#160; &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;&#160;&#160;&#160;&#160;&#160;&#160; &lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot; EnablePageMethods=&quot;true&quot;&gt;&#160;&#160;&#160;&#160;&#160; &lt;/asp:ScriptManager&gt;&#160;&#160;&#160;&#160;&#160; &lt;div&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;a href=&quot;javascript:callServerMethod()&quot; &gt;Call Server method&lt;/a&gt;&#160;&#160;&#160;&#160;&#160; &lt;/div&gt;&#160;&#160;&#160;&#160;&#160; &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;&#160;&#160;&#160;&#160;&#160; //&lt;![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function callServerMethod()&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; PageMethods.GetTime(callBackMethod);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; function callBackMethod(result)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert(result);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160; //]]&gt;&#160;&#160;&#160;&#160;&#160; &lt;/script&gt;&#160;&#160;&#160;&#160;&#160; &lt;/form&gt;
&lt;/body&gt;</pre>
</p>
<p><strong><u>Extra bits</u></strong></p>
<p>In the above code you can see that I have placed link, when user click on that link a message is shown with the server time. So behind an asynchronous request is send to the server in this format (<strong><a href="http://[sitename]/[MethodName">http://[sitename]/[MethodName</a></strong><strong>]</strong>). Server in turn returns the result as JSON back to the client. Here is a screen shot from the firebug</p>
<p><a href="http://www.rajeeshcv.com/wp-content/uploads/2008/10/image.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="384" alt="image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/10/image-thumb.png" width="422" border="0" /></a> </p>
<p><a href="http://www.rajeeshcv.com/wp-content/uploads/2008/10/image1.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="121" alt="image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/10/image-thumb1.png" width="342" border="0" /></a></p>
<p>There is optimization we have do here &#8211; you can see that, by default the request is a <strong>POST</strong> request, but in our case a POST request is heavy because we could have achieved the same using a <strong>GET</strong> request ( <a href="http://www.cs.tut.fi/~jkorpela/forms/methods.html" target="_blank">Difference between POST and GET</a> ). </p>
<p></p>
<p>In order to change this request in to a <strong>GET</strong> request, we need to do a minor tweaking in the server side, set &quot;<strong>UseHttpGet=true</strong>&quot; parameter for the &quot;<strong>ScriptMethod</strong>&quot; attribute.</p>
<pre class="c-sharp" name="code">
	[WebMethod]
        [ScriptMethod(UseHttpGet=true)]
        public static string GetTime()
        {
            return DateTime.Now.ToLongTimeString();
        }</pre>
<p>After this you can see that, request is changed to a <strong>GET </strong>request</p>
<p><a href="http://www.rajeeshcv.com/wp-content/uploads/2008/10/image2.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="355" alt="image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/10/image-thumb2.png" width="385" border="0" /></a></p>
<div class="wlWriterSmartContent" id="scid:C16BAC14-9A3D-4c50-9394-FBFEF7A93539:9c3bb28b-7aaf-4bce-a9b0-a850fec8227a" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"><a href="http://www.dotnetkicks.com/kick/?url=http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/" border="0" alt="kick it on DotNetKicks.com" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/10/aspnet-ajax-calling-server-side-methods-from-client-side/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JQuery in asp.net</title>
		<link>http://www.rajeeshcv.com/2008/09/jquery-in-aspnet/</link>
		<comments>http://www.rajeeshcv.com/2008/09/jquery-in-aspnet/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 19:17:47 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/?p=59</guid>
		<description><![CDATA[A good news for the  JQuery lovers like me; Scott Guthrie anounced that JQuery will be shipped along with Visual Studio and Microsoft is planning to use this excellent javascript library in their future control release.
]]></description>
			<content:encoded><![CDATA[<p>A good news for the  <a href="http://www.jquery.com" target="_blank">JQuery</a> lovers like me; <a href="http://weblogs.asp.net/scottgu" target="_blank"><span style="font-family: Arial; font-size: x-small;">Scott Guthrie</span></a> anounced that JQuery will be shipped along with Visual Studio and Microsoft is planning to use this excellent javascript library in their future control release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/09/jquery-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Server Error&#8221; in asp.net official website</title>
		<link>http://www.rajeeshcv.com/2008/09/server-error-in-aspnet-official-website/</link>
		<comments>http://www.rajeeshcv.com/2008/09/server-error-in-aspnet-official-website/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 16:57:33 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/?p=57</guid>
		<description><![CDATA[Today I opened  asp.net official website www.asp.net in Google chrome and this was the response&#8230;..  


But the site is working very well in IE6 and firefox  
]]></description>
			<content:encoded><![CDATA[<p>Today I opened  asp.net official website <a href="http://www.asp.net/" target="_blank">www.asp.net</a> in <a href="http://www.google.com/chrome" target="_blank">Google chrome</a> and this was the response&#8230;.. <img src='http://www.rajeeshcv.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><a href='http://www.rajeeshcv.com/wp-content/uploads/2008/09/aspnetsite.gif'><img src="http://www.rajeeshcv.com/wp-content/uploads/2008/09/aspnetsite.gif" alt="" title="aspnetsite" width="500" height="219" class="alignnone size-full wp-image-58" /></a></p>
<p></p>
<p>But the site is working very well in IE6 and firefox <img src='http://www.rajeeshcv.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/09/server-error-in-aspnet-official-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LayoutManager  &#8211; custom control for asp.net</title>
		<link>http://www.rajeeshcv.com/2008/09/layoutmanager-custom-control-for-aspnet/</link>
		<comments>http://www.rajeeshcv.com/2008/09/layoutmanager-custom-control-for-aspnet/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 17:52:36 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Custom Control]]></category>
		<category><![CDATA[LayoutManager]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/?p=56</guid>
		<description><![CDATA[I have created an asp.net custom control on top of my JQuery Plugin, with good design time support. So that you don’t need to write any lines code.
Get more details from here http://code.google.com/p/weblayoutmanager/
Please let me know your suggestions
]]></description>
			<content:encoded><![CDATA[<p>I have created an asp.net custom control on top of my JQuery Plugin, with good design time support. So that you don’t need to write any lines code.</p>
<p>Get more details from here <a href="http://code.google.com/p/weblayoutmanager/" target="_blank">http://code.google.com/p/weblayoutmanager/</a></p>
<p>Please let me know your suggestions</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/09/layoutmanager-custom-control-for-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Injection attack detection tool</title>
		<link>http://www.rajeeshcv.com/2008/06/sql-injection-attack-detection-tool/</link>
		<comments>http://www.rajeeshcv.com/2008/06/sql-injection-attack-detection-tool/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 18:43:42 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/?p=46</guid>
		<description><![CDATA[Today I found a tool called Scrawlr that will help you to detect SQL injection loop holes in your web application. I hope it will be a good add-on to your archery against security attacks.
For those who don&#8217;t know what is SQL injection – 

SQL injection is a technique that exploits a security vulnerability occurring [...]]]></description>
			<content:encoded><![CDATA[<p>Today I found a tool called <a href="http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2008/06/23/finding-sql-injection-with-scrawlr.aspx" target="_blank">Scrawlr</a> that will help you to detect SQL injection loop holes in your web application. I hope it will be a good add-on to your archery against security attacks.</p>
<p style="text-align: left;">For those who don&#8217;t know what is SQL injection –<span style="font-size: 14pt;"> </span></p>
<blockquote>
<p style="text-align: left;">SQL injection is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.</p>
</blockquote>
<p>Get more details about Scrawlr from here <a href="http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2008/06/23/finding-sql-injection-with-scrawlr.aspx" target="_blank">Check this</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/06/sql-injection-attack-detection-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
