<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7960725789043363799</id><updated>2026-09-30T05:05:26.752-07:00</updated><category term="ASP.NET"/><category term="ASP.NET Ajax"/><category term="ASP.NET MVC"/><category term="JQGrid"/><category term="NHibernate"/><category term="VS 2010"/><category term="DevExpress"/><category term="FluentNHibernate"/><category term="JavaScript"/><category term="CSS"/><category term="VS 2005"/><category term="ADO.NET"/><category term="C#"/><category term="JQuery"/><category term="JQuery UI"/><category term="Microsoft Exchange"/><category term="Mock frameworks"/><category term="SQL SERVER 2008"/><category term="SignalR"/><category term="TFS"/><category term="VC++"/><category term="XSL"/><category term=".NET Controls"/><category term="ASP.NET Optimization"/><category term="Active Directory"/><category term="Architecture"/><category term="BootMetro"/><category term="Fiddler API"/><category term="FileZilla"/><category term="IIS"/><category term="JQuery Ajax"/><category term="JQuery Plugin"/><category term="KnockoutJs"/><category term="MetroJS"/><category term="RESTful API"/><category term="SQL Server"/><category term="Selenium WebDriver"/><category term="SignalR Sample"/><category term="Sub Domain"/><category term="TechCipher"/><category term="Visual Studio 2010 Plugin"/><category term="WCF"/><category term="Web API"/><category term="WinRT App"/><category term="XAML"/><title type='text'>CSharp Techies</title><subtitle type='html'>public string aboutme {&#xa;var known = { { &quot;C#&quot; , &quot;Javascript&quot; }, { &quot;ASP.NET&quot;, &quot;MVC&quot; } };&#xa;return known.ToJson();&#xa;}&lt;br&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>106</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-7380930930768654609</id><published>2013-11-04T15:53:00.001-08:00</published><updated>2013-11-04T15:53:42.084-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="Sub Domain"/><title type='text'>Subdomain with ASP.NET MVC using Attribute Routing</title><content type='html'>ASP.NET MVC Routing allows defining various mappings and recently I have looked at an interesting framework known as &lt;a href=&quot;http://attributerouting.net/&quot;&gt;Attribute Routing&lt;/a&gt;. 
&lt;br /&gt;
&lt;br /&gt;
Using Attribute Routing setting up a subdomain for your website that uses ASP.NET MVC is very simple. Now consider you have a website www.csharptechies.com and you would want to define subdomains such as blog.csharptechies.com, projects.csharptechies.com, labels.csharptechies.com etc.... Each of these subdomain can be a different project (any technology such as webforms, MVC etc) by themselves or can be an area defined in an ASP.NET MVC project.
&lt;br /&gt;
&lt;br /&gt;
Lets consider we are going to follow the approach of having areas inside ASP.NET MVC project. Here are the list of steps to achieve this.
&lt;br /&gt;
&lt;br /&gt;
1. Create your ASP.NET MVC project with all the content and publish to your IIS. You should now be able to access your website using http://localhost/csharptechies or based on your machine http://saifpc.localhost.com/csharptechies. You could define hosts file to include the references. 
&lt;br /&gt;
&lt;br /&gt;
I have added following to &quot;hosts&quot; file under C:\Windows\System32\Drivers\etc with data as
&lt;br /&gt;
&lt;br /&gt;
127.0.0.1 www.csharptechies.com
&lt;br /&gt;
&lt;br /&gt;
Now website can be accessed as www.csharptechies.com\csharptechies(ie.. http://localhost/csharptechies)
&lt;br /&gt;
&lt;br /&gt;
2. Lets code for subdomain routing. First add references for attribute routing via nuget using &quot;Install-Package AttributeRouting&quot;
&lt;br /&gt;
&lt;br /&gt;
3. Create an area with the name &quot;Blog&quot;.
&lt;br /&gt;
&lt;br /&gt;
4. Add a new folder &quot;Blog&quot; under &quot;Areas\Blog\Views&quot;. create a new view &quot;articles&quot; under &quot;Areas\Blog\Views\Blog&quot;
&lt;br /&gt;
&lt;br /&gt;
5. Add a controller BlogController.cs with following code under &quot;Areas\Blog\Controllers&quot;
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt; [RouteArea(&quot;Blog&quot;, Subdomain = &quot;blog&quot;)]
    public class BlogController : Controller
    {
        //
        // GET: /articles/
        [GET(&quot;&quot;)]
        public ActionResult articles()
        {
            return View();
        }
    }
&lt;/pre&gt;
6. Update &quot;AttributeRoutingConfig.cs&quot; to add routing to blog
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;public static class AttributeRoutingConfig
 {
  public static void RegisterRoutes(RouteCollection routes) 
  {   
routes.MapAttributeRoutes(config =&amp;gt; config.AddRoutesFromController&lt;blogcontroller&gt;());
  }

        public static void Start() 
  {
            RegisterRoutes(RouteTable.Routes);
        }
    }
&lt;/pre&gt;
&lt;br /&gt;
7. Now add new entry to hosts file 
&lt;br /&gt;
&lt;br /&gt;
127.0.0.1 blog.csharptechies.com
&lt;br /&gt;
&lt;br /&gt;
8. Publish latest version of the project and using IE browse to the website as 
&lt;br /&gt;
&lt;br /&gt;
http://blog.csharptechies.com/csharptechies
&lt;br /&gt;
&lt;br /&gt;
This will show the view as articles, since BlogController now understands the attribute definition of subdomain as &quot;blog&quot; it will route the url to blog instead of standard csharptechies website. You could also look at possible routing via www.csharptechies.com\csharptechies\routes.axd
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important.&lt;br /&gt;
Bill Gates &lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/7380930930768654609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/11/subdomain-with-aspnet-mvc-using.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/7380930930768654609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/7380930930768654609'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/11/subdomain-with-aspnet-mvc-using.html' title='Subdomain with ASP.NET MVC using Attribute Routing'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-5366082580218876778</id><published>2013-10-25T10:36:00.000-07:00</published><updated>2013-10-25T10:36:27.069-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><title type='text'>Restricting access to a webservice in ASP.NET</title><content type='html'>Restricting access to a webservice can be done via web.config but if you would want to make the decision at runtime then here is an example of how you could achieve this

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt; 

protected void Application_BeginRequest(Object sender, EventArgs e)
{
  if (/*Condition*/)
  {
    if (HttpContext.Current.Request.Url.ToString().Contains(&quot;Admin.asmx&quot;))
    {
       HttpContext.Current.Response.StatusCode = 404;
    }
   }
}
&lt;/pre&gt;

&lt;i&gt;
Genius ain&#39;t anything more than elegant common sense. &lt;br /&gt;
Josh Billings
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/5366082580218876778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/10/restricting-access-to-webservice-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/5366082580218876778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/5366082580218876778'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/10/restricting-access-to-webservice-in.html' title='Restricting access to a webservice in ASP.NET'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-2668210092545003687</id><published>2013-10-16T16:12:00.003-07:00</published><updated>2013-10-16T16:20:18.790-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mock frameworks"/><title type='text'>Mock frameworks for .NET Part 2</title><content type='html'>As we have already seen the basics of Mock framework, let&#39;s look at some of Mock frameworks that are available and understand what they do or don&#39;t support.

&lt;h2&gt;NMock&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;

&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;Apache License 2.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Jul-2011&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;NMock3&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 4.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://nmock3.codeplex.com/&quot;&gt;http://nmock3.codeplex.com/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;h2&gt;TypeMock&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;Commercial&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Jul-2013&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;Isolater 7.4.1&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 4.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;Yes (Microsoft TFS, MSBuild, Nant, Final Builder)&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;Yes (CoverageEye, NCover, PartCover, DevPartner, Clover.NET, ExactMagic&#39;s TestMatrix, MSTest Code Coverage (Visual Studio and Team System), dotTrace, ReSharper, AQtime)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.typemock.com/isolator-product-page&quot;&gt;http://www.typemock.com/isolator-product-page&lt;/a&gt;&lt;/td&gt;
&lt;tr&gt;

&lt;/table&gt;

&lt;h2&gt;Rhino Mocks&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;BSD license&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Jan-2010&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;Rhino Mocks 3.6&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 3.5&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://hibernatingrhinos.com/oss/rhino-mocks&quot;&gt;http://hibernatingrhinos.com/oss/rhino-mocks&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;h2&gt;Moq&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;BSD license&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Apr-2011&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;Moq 4.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 3.5&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://code.google.com/p/moq/&quot;&gt;https://code.google.com/p/moq/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;h2&gt;Nsubstitute&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;BSD license&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Aug-13&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;NSubstitute-1.6.1.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 4.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://nsubstitute.github.io/&quot;&gt;http://nsubstitute.github.io/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;h2&gt;JustMock&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;Full Version - Commercial, Lite - Free&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Oct-2013&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;V 2013.3.1015.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 4.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;Yes (TFS, CruiseControl.NET, Team City &amp; Jenkins etc)&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;Yes (NCover, PartCover, JetBrains dotTrace, PostSharp etc)&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://www.telerik.com/products/mocking.aspx&quot;&gt;http://www.telerik.com/products/mocking.aspx&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;h2&gt;FakeItEasy&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;MIT License&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Oct-2013&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;v 1.13.1&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 3.5&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://github.com/FakeItEasy/FakeItEasy&quot;&gt;https://github.com/FakeItEasy/FakeItEasy&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;

&lt;h2&gt;Microsoft Flakes&lt;/h2&gt;
&lt;hr /&gt;
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Software License&lt;/td&gt;
&lt;td&gt;Commercial with Visual Studio&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Last Active&lt;/td&gt;
&lt;td&gt;Mar-2013&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Latest Version&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Supported .NET Version&lt;/td&gt;
&lt;td&gt;.NET 4.0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Build Server Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Code Coverate Integration&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Interfaces&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Everything&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Mock Legacy Code&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Auto Recursive Fakes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Fake Dependencies&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Url&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/hh549175.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/hh549175.aspx&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;
Now you should be able to select the right framework that suits your needs.&lt;br /&gt;&lt;br /&gt;
&lt;i&gt;
It&#39;s fine to celebrate success but it is more important to heed the lessons of failure.&lt;br /&gt;
Bill Gates &lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/2668210092545003687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/10/mock-frameworks-for-net-part-2_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/2668210092545003687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/2668210092545003687'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/10/mock-frameworks-for-net-part-2_16.html' title='Mock frameworks for .NET Part 2'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-4819636166997462481</id><published>2013-10-07T16:34:00.001-07:00</published><updated>2013-10-16T15:37:51.055-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mock frameworks"/><title type='text'>Mock frameworks for .NET Part 1</title><content type='html'>Mock frameworks are used for unit testing your code and are used for Test Driven Development (TDD). A mock framework should support Arrange Act Assert (AAA) pattern. There are various mock frameworks available and choosing the right one is not easy. Before looking at various frameworks available let&#39;s understand some basics of what a framework should have to be known as a Mock framework.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;Mock Interfaces &amp;amp; abstract classes&lt;/h3&gt;
Interfaces or Abstract classes allows Mock framework to be able to create stubs, A stub is a small block of code that is replacement of another component or code block. TDD approach of R-G-R (Red-Green-Refactor) is an example where a stub might be useful. In order to make a test successfull (Green), you would need a stub for places where actual definition is either not written or unknown.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;Mock Everything in .NET&lt;/h3&gt;
Able to mock everything in a class, such as 
&lt;ul&gt;
&lt;li&gt;mock dependent objects&lt;/li&gt;
&lt;li&gt;non-virtual methods&lt;/li&gt;
&lt;li&gt;sealed classes&lt;/li&gt;
&lt;li&gt;static methods&lt;/li&gt;
&lt;li&gt;static classes&lt;/li&gt; 
&lt;li&gt;non-public members&lt;/li&gt;
&lt;li&gt;non-public types&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;h3&gt;Mock Legacy Code&lt;/h3&gt;
Assume some legacy code that has got some core business logic but has been designed/coded way before TDD has even started
&lt;ul&gt;
&lt;li&gt;no interfaces&lt;/li&gt; 
&lt;li&gt;no abstract classes&lt;/li&gt;
&lt;li&gt;has dependencies&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;h3&gt;Auto Recursive Fakes&lt;/h3&gt;
Once a mock is created some methods and properties will automatically return non null values such as interfaces, delegate, virtual class etc. This is also known as recursive mock.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;Fake Dependencies&lt;/h3&gt;
If a mock is dependent on another object, framework should allow to either populate or assign dependency so as to make the test succeed. Most of the frameworks will support it by default.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;Unit Test Integration&lt;/h3&gt;
Allow easy integration with unit test tools such as NUnit, MSTest, Xunit etc.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;Build Server Integration&lt;/h3&gt;
Mock framework should allow you to be able to automate unit tests as part of your build &amp; continuous integration. It should be able to support various build servers such as TFS, MSBuild, Nant, CruiseControl.NET etc
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;Code coverage Integration&lt;/h3&gt;
Mock framework should allow to be integrated with 3rd party code coverage so as to produce various metrics that can easily point out areas of code that has not been covered by a unit test or has been wrongly written. It should be able to support various 3rd party code coverage software such as NCover, MSTest Code Coverage, ReSharper etc.
&lt;br/&gt;&lt;br/&gt;
All of the these are only related to .net code. The mock framework features that are required for javascript mocking is out of scope of this article. The list of mock frameworks can be seen at &lt;a href=&quot;http://csharptechies.blogspot.co.uk/2013/10/mock-frameworks-for-net-part-2.html&quot;&gt;Mock frameworks for .NET Part 2&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
Intelligence is the ability to adapt to change.&lt;br/&gt;
Stephen Hawking 
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/4819636166997462481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/10/mock-frameworks-for-net-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4819636166997462481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4819636166997462481'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/10/mock-frameworks-for-net-part-1.html' title='Mock frameworks for .NET Part 1'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-4888654030484278394</id><published>2013-09-25T14:42:00.000-07:00</published><updated>2013-09-26T01:09:08.170-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="RESTful API"/><category scheme="http://www.blogger.com/atom/ns#" term="Web API"/><title type='text'>Using ASP.NET Web API for streaming pictures</title><content type='html'>ASP.NET Web API 2.0 provides various new features and one of which is &lt;a href=&quot;http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2&quot;&gt;Attribute Routing&lt;/a&gt;. Attribute routing allows custom configuration for routing by assigning attribute to the web method.
&lt;br /&gt;&lt;br /&gt;
Get latest version of ASP.NET Web API 2.0 via Nuget package
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
Install-Package Microsoft.AspNet.WebApi.WebHost
&lt;/pre&gt;
Update WebApiConfig to include config.MapHttpAttributeRoutes()
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt; public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: &quot;DefaultApi&quot;,
                routeTemplate: &quot;api/{controller}/{id}&quot;,
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
&lt;/pre&gt;
The [HttpGet] attribute defines an HTTP GET method. Now create RESTful endpoint using web api  
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
[HttpGet(&quot;api/invoice/scan/{id}&quot;)]
public HttpResponseMessage GetScannedInvoiceById(string id)
{
 HttpResponseMessage result = new HttpResponseMessage();
 string isPath = GetInoviceScanPath(id);
        result.Content = new StreamContent(new FileStream(isPath, FileMode.Open));
 result.Content.Headers.ContentType = new MediaTypeHeaderValue(&quot;image/png&quot;);
 return result;
}
&lt;/pre&gt;

http://localhost/csharptechies/api/invoice/scan/1908765 will now get the image as HttpResponseMessage.
&lt;br /&gt;&lt;br /&gt;
Apart from using attributes to define an uri for controller methods, &lt;a href=&quot;http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2#prefixes&quot;&gt;Route Prefixes&lt;/a&gt; can be defined as a controller attribute that will become base uri for for all of the controller methods.
&lt;br /&gt;&lt;br /&gt;
&lt;i&gt;
Do you realize if it weren&#39;t for Edison we&#39;d be watching TV by candlelight.&lt;br /&gt;
Al Boliska 
&lt;/i&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/4888654030484278394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/09/using-aspnet-web-api-20-restful-api-for.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4888654030484278394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4888654030484278394'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/09/using-aspnet-web-api-20-restful-api-for.html' title='Using ASP.NET Web API for streaming pictures'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-8211766586298296669</id><published>2013-09-21T05:41:00.000-07:00</published><updated>2013-09-21T05:50:33.718-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Architecture"/><title type='text'>Server Side MVC vs Client Side MVC</title><content type='html'>&lt;a href=&quot;http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller&quot;&gt;MVC (Model–view–controller)&lt;/a&gt; is an architecture patterns that addresses separation of concerns, test driven development, statelessness, extensibility, SEO, REST and many more. Choosing MVC pattern for developing web application is a very easy decision, but that is just the beginning. Rest of decision is deciding how to design, develop and implement the web application.Now deciding on &quot;Server Side MVC&quot; or &quot;Client Side MVC&quot; is not any easy job as there are number of options available.
&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;Server Side MVC&lt;/h2&gt;

&lt;h3&gt;Overview&lt;/h3&gt;
Server side MVC is a combination of server-side framework and javascript/jquery. There are various server-side framework&#39;s available depending on the platform you are developing. Here is a list of few of them
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.asp.net/mvc&quot;&gt;ASP.NET MVC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.tutorialspoint.com/ruby-on-rails/rails-framework.htm&quot;&gt;Ruby on Rails MVC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.oracle.com/technetwork/articles/javase/index-142890.html&quot;&gt;Java MVC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sitepoint.com/the-mvc-pattern-and-php-1/&quot;&gt;PHP MVC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.catalystframework.org/&quot;&gt;Perl MVC&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Why&lt;/h3&gt;
Various benefits of using Server Side MVC are 
&lt;ul&gt;
&lt;li&gt;Mature (been there for year)&lt;/li&gt;
&lt;li&gt;Routing decided by Server&lt;/li&gt;
&lt;li&gt;Server renders the views&lt;/li&gt;
&lt;li&gt;Server binds model to views&lt;/li&gt;
&lt;li&gt;View request can return html, json, xml, text, binary etc&lt;/li&gt;
&lt;li&gt;CRUD managed by Controller &amp; Data Models on Server&lt;/li&gt;
&lt;li&gt;Code security&lt;/li&gt;
&lt;li&gt;Routing decided on application start&lt;/li&gt;
&lt;li&gt;Supports multi-page application&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Client Side MVC&lt;/h2&gt;

&lt;h3&gt;Overview&lt;/h3&gt;
Client Side MVC is a combination of js frameworks and REST API. Partially still relies on server side application for providing REST API. There are various client-side framework&#39;s available depending on your choice of coding style. Here is a list of few of them
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://backbonejs.org/&quot;&gt;Backbone.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://emberjs.com/&quot;&gt;Ember.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://knockoutjs.com/&quot;&gt;Knockout.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://angularjs.org/&quot;&gt;AngularJS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dojotoolkit.org/&quot;&gt;Dojo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://agilityjs.com/&quot;&gt;Agility.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://kmalakoff.github.io/knockback/&quot;&gt;Knockback.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Why&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Recently introduced but got more attention now (look at the list of &lt;a href=&quot;http://backbonejs.org/#examples&quot;&gt;examples&lt;/a&gt; where backbone.js is used&lt;/li&gt;
&lt;li&gt;Routing decided by Client&lt;/li&gt;
&lt;li&gt;Client renders the views&lt;/li&gt;
&lt;li&gt;Client binds model to views via javascript frameworks&lt;/li&gt;
&lt;li&gt;Uses REST API for getting data from server&lt;/li&gt;
&lt;li&gt;CRUD managed by Controller &amp; Data Models on Client via REST API&lt;/li&gt;
&lt;li&gt;Started with single-page application, but now various frameworks support multi-page application&lt;/li&gt;
&lt;li&gt;Routing can be modified dynamically as it is maintained on client&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;
Look at &lt;a href=&quot;http://todomvc.com/&quot;&gt;TODO MVC&lt;/a&gt; for more options on Client Side MVC. 
&lt;br /&gt;&lt;br /&gt;
Also you could use mixture of both Server Side MVC and Client Side MVC. I have used this combination ASP.NET MVC + KnockoutJS on &lt;a href=&quot;http://techcipher.com/&quot;&gt;Techcipher&lt;/a&gt;.
&lt;br /&gt;&lt;br /&gt;
&lt;i&gt;
Think? Why think! We have computers to do that for us.&lt;br /&gt;
Jean Rostand 
&lt;/i&gt;


</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/8211766586298296669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/09/server-side-mvc-vs-client-side-mvc.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/8211766586298296669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/8211766586298296669'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/09/server-side-mvc-vs-client-side-mvc.html' title='Server Side MVC vs Client Side MVC'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-2819284674572242846</id><published>2013-09-15T16:19:00.002-07:00</published><updated>2013-09-15T16:20:48.750-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><title type='text'>Streaming millions of rows as a csv in ASP.NET MVC</title><content type='html'>Generating reports using the data from the database is something any project will generally have, but to be able to actually download all of the data as a csv is not easy. Not just thousands of rows but if database has millions of rows then challange will be to decide best approach. Consider following approaches
&lt;br/&gt;&lt;br/&gt;
1. Generate the report on server and then stream the file to clients machine&lt;br/&gt;&lt;br/&gt;
2. Stream data in batches onto client machine&lt;br/&gt;&lt;br/&gt;

First approach is not a good idea as there is no feedback to the user when download will actually start, but with second option user will actually see the streaming immediately.
&lt;br/&gt;&lt;br/&gt;
So let&#39;s look at option 2 and how that can be achieved
&lt;br/&gt;&lt;br/&gt;
1. Define a custom result that derives from FileResult
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
public class CsvResult : FileResult
{
   protected override void WriteFile(HttpResponseBase response)
   {
            response.Clear();
            response.ClearContent();
            response.BufferOutput = false;
            var streamWriter = new StreamWriter(response.OutputStream, Encoding.UTF8);
            //write the header line first
            streamWriter.WriteLine(&quot;InvoiceDate,InvoiceNumber,Quantity,Price&quot;);
            long count = GetInvoiceRecCount();
            
            long batchSize = 10000;
            long numberOfBatches = count / batchSize;
            long startRow = 0;
            for (int i = 0; i &lt; numberOfBatches; i++)
            {
                startRow = i * batchSize;
                //Get batch of rows
                var invoiceRows = GetInvoiceRows(startRow, batchSize);
                foreach(DataRow row in invoiceRows)
                {
                    //write data 
                    streamWriter.WriteLine(dataLine);
                }

                streamWriter.Flush();
            }

            if (startRow + batchSize &lt; count)
            {
                batchSize = count - startRow;
                //Get batch of rows
                var invoiceRows = GetInvoiceRows(startRow, batchSize);
                //write final batch
                foreach (DataRow row in invoiceRows)
                {
                    //write data 
                    streamWriter.WriteLine(dataLine);
                }

                streamWriter.Flush();
            }
   }

}
&lt;/pre&gt;
2. Now write controller action
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
public ActionResult ExportInvoicesToCsv()
{
   CsvResult csvResult = new CsvResult();
   csvResult.FileDownloadName = &quot;InvoiceReport.csv&quot;;
   return csvResult;
}
&lt;/pre&gt;
And that&#39;s it all done. Now when user tries to download millions of rows as csv they are batches in the size of 10000 and will be streamed to users machine.
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important.&lt;br/&gt;
Bill Gates
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/2819284674572242846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/09/streaming-millions-of-rows-as-csv-using.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/2819284674572242846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/2819284674572242846'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/09/streaming-millions-of-rows-as-csv-using.html' title='Streaming millions of rows as a csv in ASP.NET MVC'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-2714004210283476011</id><published>2013-07-17T05:59:00.001-07:00</published><updated>2013-07-17T06:04:07.272-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Enabling HTTP Handler to render in IE Compatibility mode</title><content type='html'>HTTP handlers are generally used for download a file, show an image, or even to show a report (ie.. generated as html at runtime and stream it through)
&lt;br/&gt;&lt;br/&gt;
Now consider your html report was generated and now all you need to do is show through your website using ASP.NET http handler. Opening the report html just show all the formatting properly but via http handler some of styles were not correctly applied.
&lt;br/&gt;&lt;br/&gt;
To resolve this you have got 2 options&lt;br/&gt;
- Modify your CSS to render it properly&lt;br/&gt;
- Force your handler to render in compatibility mode
&lt;br/&gt;&lt;br/&gt;
In order to force your handler to render in compatibility mode all you need is to just add a header
&lt;br/&gt;&lt;br/&gt;
for eg you can force usage of IE8
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
Response.AddHeader(&quot;X-UA-Compatible&quot;, &quot;IE=EmulateIE8&quot;);
&lt;/pre&gt;
&lt;br/&gt;&lt;br/&gt;
or use microsoft standard. Refer to microsoft article &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx&quot;&gt;&quot;Specifying legacy document modes&quot;&lt;/a&gt;
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
Response.AddHeader(&quot;X-UA-Compatible&quot;, &quot;IE=edge&quot;);
&lt;/pre&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
Be nice to nerds. Chances are you&#39;ll end up working for one.&lt;br/&gt;
Bill Gates, Microsoft
&lt;/i&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/2714004210283476011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/07/enabling-http-handler-to-render-in-ie.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/2714004210283476011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/2714004210283476011'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/07/enabling-http-handler-to-render-in-ie.html' title='Enabling HTTP Handler to render in IE Compatibility mode'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-9051384519336980018</id><published>2013-07-10T09:32:00.000-07:00</published><updated>2013-07-12T08:39:35.462-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DevExpress"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium WebDriver"/><title type='text'>Using Selenium WebDriver to simulate button click for ASP.NET Webforms application that uses DevExpress Controls</title><content type='html'>First lets create a simple ASP.NET Web application that uses DevExpress controls. I have created a test.aspx page that has got 2 buttons 
&lt;br/&gt;&lt;br/&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Edv7catm_3wfilPP-qJeeQlDXDjrX2UqQl6go0h6mu-rKOy-g25k3llkci3-kbRQOn_NXNWceUJYeRm7x-IDUbH_zBV29u6rlHw1pyGVhE57d1664TtVdnGRkURZex6QuvMoqw_HzFzV/s1600/webpage.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Edv7catm_3wfilPP-qJeeQlDXDjrX2UqQl6go0h6mu-rKOy-g25k3llkci3-kbRQOn_NXNWceUJYeRm7x-IDUbH_zBV29u6rlHw1pyGVhE57d1664TtVdnGRkURZex6QuvMoqw_HzFzV/s320/webpage.png&quot; /&gt;&lt;/a&gt;

&lt;br/&gt;&lt;br/&gt;
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
&lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;div&gt;    
        &lt;dx:ASPxButton ID=&quot;TestMe&quot; runat=&quot;server&quot; Text=&quot;Test Me&quot; Theme=&quot;Aqua&quot; onclick=&quot;TestMe_Click&quot;&gt;
        &lt;/dx:ASPxButton&gt;

        &lt;dx:ASPxButton ID=&quot;TestMe2&quot; runat=&quot;server&quot; Text=&quot;Test Me 2&quot; Theme=&quot;Aqua&quot; onclick=&quot;TestMe2_Click&quot;&gt;
        &lt;/dx:ASPxButton&gt;
    &lt;/div&gt;
&lt;/form&gt;
&lt;/pre&gt;
&lt;br/&gt;&lt;br/&gt;
Code behind (test.aspx.cs)
&lt;br/&gt;&lt;br/&gt;
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
protected void TestMe_Click(object sender, EventArgs e)
{
  Response.Redirect(&quot;success.aspx&quot;);
}

protected void TestMe2_Click(object sender, EventArgs e)
{
  Response.Redirect(&quot;Fail.aspx&quot;);
}
&lt;/pre&gt;
&lt;br/&gt;&lt;br/&gt;

Now here is the snippet of code that can be used to simulate button click 

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
WebDriver driver = new InternetExplorerDriver(@&quot;C:\selenium\selenium-dotnet-2.33.0\IEDriverServer_x64_2.33.0&quot;);
driver.Navigate().GoToUrl(&quot;http://localhost/test/Test.aspx&quot;);
IJavaScriptExecutor js = driver as IJavaScriptExecutor;
var result = js.ExecuteScript(&quot;TestMe.click();&quot;);
//or
IWebElement btn = driver.FindElement(By.Id(&quot;TestMe&quot;));
btn.Click();

&lt;/pre&gt;

Use this &lt;a href=&quot;http://www.joecolantonio.com/2012/07/31/getting-started-using-selenium-2-0-webdriver-for-ie-in-visual-studio-c/&quot;&gt;Quick Start&lt;/a&gt; guide to setup your machine for testing ASP.NET Web applications. For more detailed or complete understanding goto &lt;a href=&quot;http://docs.seleniumhq.org/docs/03_webdriver.jsp#introducing-webdriver&quot;&gt;Selenium WebDriver&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
Nearly all men can stand adversity, but if you want to test a man&#39;s character, give him power.
Abraham Lincoln &lt;/i&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/9051384519336980018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/07/using-selenium-webdriver-to-simulate.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/9051384519336980018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/9051384519336980018'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/07/using-selenium-webdriver-to-simulate.html' title='Using Selenium WebDriver to simulate button click for ASP.NET Webforms application that uses DevExpress Controls'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Edv7catm_3wfilPP-qJeeQlDXDjrX2UqQl6go0h6mu-rKOy-g25k3llkci3-kbRQOn_NXNWceUJYeRm7x-IDUbH_zBV29u6rlHw1pyGVhE57d1664TtVdnGRkURZex6QuvMoqw_HzFzV/s72-c/webpage.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-7687083644255866174</id><published>2013-06-13T17:04:00.000-07:00</published><updated>2013-06-14T03:31:19.808-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BootMetro"/><category scheme="http://www.blogger.com/atom/ns#" term="MetroJS"/><title type='text'>Live tiles with Bootmetro and Metro JS</title><content type='html'>&lt;a href=&quot;http://aozora.github.io/bootmetro&quot;&gt;Bootmetro&lt;/a&gt; is a simple web ui framework which I have used on my website &lt;a href=&quot;TechCipher&quot;&gt;TechCipher&lt;/a&gt;. There are various samples inside Bootmetro for implementing various type of tiles but not for live tiles. This article will give you insight of how live tiles can be implemented with Bootmetro and Metro JS. 

1. Define tile 

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
&lt;a class=&quot;tile wide text bg-color-blue&quot; href=&quot;#&quot;&gt;       
  &lt;div class=&quot;live-tile two-wide bg-color-blue&quot; data-speed=&quot;750&quot; data-delay=&quot;3000&quot; style=&quot;width: 260px !important;background-color: Gray;height: 100px !important;&quot;&gt;
   &lt;span class=&quot;tile-title&quot;&gt;Latest Updates&lt;/span&gt;
   &lt;div class=&quot;bg-color-blue&quot;&gt;Bootmetro is a simple web ui framework&lt;/div&gt;
   &lt;div class=&quot;bg-color-blue&quot;&gt;TechCipher is all about exploring technologies available to date&lt;/div&gt;
  &lt;/div&gt;     
&lt;/a&gt;
&lt;/pre&gt;

2. Add references to MetroJs (css and js)

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/MetroJs.Full.0.9.5/MetroJs.min.js&quot;&gt;&lt;/script&gt;
..
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;scripts/MetroJs.Full.0.9.5/metrojs.min.css&quot;&gt;
&lt;/pre&gt;

3. Finally make your tile live

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
  $(&quot;.metro&quot;).metro();
  $(&quot;.live-tile, .flip-list&quot;).not(&quot;.exclude&quot;).liveTile();
&lt;/script&gt;
&lt;/pre&gt;

Now this is how it would look

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhY4CJJVUohz2lQvyIk6IEJEbFKgTs981j2YCkmsL8aazaVedH3oBoXgj1W-_yxLQWjK1v9Ad63f3GVIHnIewjtvalmUPSzGqcKJxs68jTbHmymLVM-9ruuo5KDcdCD7Tr4CnEituwtnrK/s1600/livetiles.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhY4CJJVUohz2lQvyIk6IEJEbFKgTs981j2YCkmsL8aazaVedH3oBoXgj1W-_yxLQWjK1v9Ad63f3GVIHnIewjtvalmUPSzGqcKJxs68jTbHmymLVM-9ruuo5KDcdCD7Tr4CnEituwtnrK/s1600/livetiles.png&quot; /&gt;&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
That&#39;s it.
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
“Before software should be reusable, it should be usable.”
– Ralph Johnson 
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/7687083644255866174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/06/live-tiles-with-bootmetro.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/7687083644255866174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/7687083644255866174'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/06/live-tiles-with-bootmetro.html' title='Live tiles with Bootmetro and Metro JS'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhY4CJJVUohz2lQvyIk6IEJEbFKgTs981j2YCkmsL8aazaVedH3oBoXgj1W-_yxLQWjK1v9Ad63f3GVIHnIewjtvalmUPSzGqcKJxs68jTbHmymLVM-9ruuo5KDcdCD7Tr4CnEituwtnrK/s72-c/livetiles.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-4219418817546887533</id><published>2013-06-06T06:19:00.000-07:00</published><updated>2013-06-06T06:19:03.069-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DevExpress"/><category scheme="http://www.blogger.com/atom/ns#" term="VS 2010"/><title type='text'>Input string was not in a correct format exception thrown by DevExpress controls</title><content type='html'>Recently I have stumped upon an exception thrown by DevExpress controls and this is trace : &lt;br/&gt;
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
2013-06-04 15:29:37.9138   6: csdrtg55bpufcimx3dm2o145 Error:global_asax threw EXCEPTION: Input string was not in a correct format.
2013-06-04 15:29:37.9138   6: csdrtg55bpufcimx3dm2o145    SOURCE:mscorlib 
2013-06-04 15:29:37.9138   6: csdrtg55bpufcimx3dm2o145    METHOD:StringToNumber 
2013-06-04 15:29:37.9138   6: csdrtg55bpufcimx3dm2o145    STACK is as follows:
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Int32.Parse(String s)
   at DevExpress.Web.ASPxEditors.ListEditItemsSerializingHelper.ParseItemIndex(String serializedItem, Int32&amp; startPos)
   at DevExpress.Web.ASPxEditors.ListBoxItemsSerializingHelper.DeserializeItems(String serializedItems, Boolean sortRequired)
   at DevExpress.Web.ASPxEditors.ListBoxProperties.SynchronizeItems(String serializedItems, Boolean isInsertingSyncType)
   at DevExpress.Web.ASPxEditors.ASPxComboBox.SynchronizeItems(NameValueCollection postCollection)
   at DevExpress.Web.ASPxEditors.ASPxComboBox.LoadPostData(NameValueCollection postCollection)
   at DevExpress.Web.ASPxClasses.ASPxWebControl.LoadPostDataInternal(NameValueCollection postCollection, Boolean raisePostDataEvent) 
2013-06-04 15:29:39.7810   6: csdrtg55bpufcimx3dm2o145 Callback error message : Input string was not in a correct format. 
&lt;/pre&gt;

&lt;br/&gt;&lt;br/&gt;

Everything works fine If I debug the code and I am not able to see any exception been thrown. So made so many changes to code to see cause of failure but finally gave up. 

Then realised that visual studio allows you to catch CLR exceptions and here are the steps I have taken to find out the culprit :
&lt;br/&gt;
1. First disable &quot;Just My Code&quot;. &lt;br/&gt;
Tools -&gt; Options&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit481MVBMK44aBhnhHpvxpLJFaXP8hwWbQ_7JhDA7stpoywOrPNx7dwlR9YLYVm7F-B6kyDJ3VFAw2i9jiDm9PvkqvzgdmiCcCDClMW-iqOciIuBPVsQPYIutU9RvyyNICA78C3zAcTSdI/s1600/DisableJustMyCode.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit481MVBMK44aBhnhHpvxpLJFaXP8hwWbQ_7JhDA7stpoywOrPNx7dwlR9YLYVm7F-B6kyDJ3VFAw2i9jiDm9PvkqvzgdmiCcCDClMW-iqOciIuBPVsQPYIutU9RvyyNICA78C3zAcTSdI/s320/DisableJustMyCode.png&quot; /&gt;&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
2. Enable CLR exceptions&lt;br/&gt;
Debug -&gt; Exceptions&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixogSovpzYVUK6Fvu7IPNM1lU2qd78ZB2wIcwsZZP-OqREkKIGBTQXMKONMElNrnYgvk8Qw6-CoquWMheH9_g6NBoWMpq-uxn34Mv6MzIKVl-iX4X81kIdB8qD7ohU_UyjLcPUnJHHZmE7/s1600/CLRExceptions.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixogSovpzYVUK6Fvu7IPNM1lU2qd78ZB2wIcwsZZP-OqREkKIGBTQXMKONMElNrnYgvk8Qw6-CoquWMheH9_g6NBoWMpq-uxn34Mv6MzIKVl-iX4X81kIdB8qD7ohU_UyjLcPUnJHHZmE7/s320/CLRExceptions.png&quot; /&gt;&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
3. Now start debugging the code and skip all exceptions until you reach the exception that you are looking for. &lt;br/&gt;&lt;br/&gt;
4. After seeing the exception that you are looking for, use &quot;Ok&quot; button not &quot;Continue&quot; button.&lt;br/&gt;&lt;br/&gt;
5. Now see call stack window&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd6mBV3Tnp_nClK9SAEWdPFin-Fmf645JI9Koa5nKH-FbbdpciM34-HAKPYcf3qzczOTaZbCBtfmf8ASoKds23XdKLYVPF-5nTWJIryOI5qzI18e9YgNNsDueNRud80zhziv1y2ArOhkHA/s1600/CallStack.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd6mBV3Tnp_nClK9SAEWdPFin-Fmf645JI9Koa5nKH-FbbdpciM34-HAKPYcf3qzczOTaZbCBtfmf8ASoKds23XdKLYVPF-5nTWJIryOI5qzI18e9YgNNsDueNRud80zhziv1y2ArOhkHA/s320/CallStack.png&quot; /&gt;&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
6. You will have enable &quot;Parameter Names&quot; to see the control name that has caused the issue&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7ZkZqfk93jIP6d68_-QA-4qrxs4ClnLSyxYYv5MHdkZXVa_njElpWArszhZz5ktDOmb_JRLCE7azxwp-YwF7vdUBFCnG3BJGuW7CkoxglbD8vfHREb7qDQ-mHihPmnfMa4gOEaIUc72l_/s1600/CallStackParams.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7ZkZqfk93jIP6d68_-QA-4qrxs4ClnLSyxYYv5MHdkZXVa_njElpWArszhZz5ktDOmb_JRLCE7azxwp-YwF7vdUBFCnG3BJGuW7CkoxglbD8vfHREb7qDQ-mHihPmnfMa4gOEaIUc72l_/s320/CallStackParams.png&quot; /&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;

Now your callstack should show something like this
&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbxwiwxRn3CKa6MDA0CAAslZYozPE_jhxZBDVhqlm1kWD77G-7h-o3kpIu31e7CAVab6be3NK87RT_IV78Dig-1g57IKWKMD3hgY0caemBdCQBTK6d_EjFh1uFc74jOqkdJPQ2w1ut2adZ/s1600/CallStackDetails.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbxwiwxRn3CKa6MDA0CAAslZYozPE_jhxZBDVhqlm1kWD77G-7h-o3kpIu31e7CAVab6be3NK87RT_IV78Dig-1g57IKWKMD3hgY0caemBdCQBTK6d_EjFh1uFc74jOqkdJPQ2w1ut2adZ/s320/CallStackDetails.png&quot; /&gt;&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
Callstack will show you the control name and its data that has caused the failure.
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
Man is the best computer we can put aboard a spacecraft... and the only one that can be mass produced with unskilled labor.  ~Werner von Braun&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/4219418817546887533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/06/input-string-was-not-in-correct-format.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4219418817546887533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4219418817546887533'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/06/input-string-was-not-in-correct-format.html' title='Input string was not in a correct format exception thrown by DevExpress controls'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-6115538259917834540</id><published>2013-04-26T03:44:00.000-07:00</published><updated>2013-04-26T03:44:02.269-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NHibernate"/><title type='text'>Set deadlock priority with NHibernate</title><content type='html'>Sometimes you would want to explicitly set &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms186736.aspx&quot;&gt;dead lock priority&lt;/a&gt; as part of a transaction which is not possible if you are using NHibernate as of now. In such cases you can define a custom Interceptor which does the trick. Here is a small snippet of code that can help you achieve that: &lt;br/&gt;

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
public class DeadLockPriorityInterceptor : EmptyInterceptor
{
 private ISession session;
 private string priority;

 public DeadLockPriorityInterceptor(string Priority)
 {
  priority = Priority;
 }

 public override void AfterTransactionBegin(ITransaction tx)
 {
  using (var command = session.Connection.CreateCommand())
  {
   session.Transaction.Enlist(command);
   string sql = string.Format(&quot;SET DEADLOCK_PRIORITY {0}&quot;, priority);
   // Create a SQL Command
   //System.Data.IDbCommand command = session.Connection.CreateCommand();
   // Set the query you&#39;re going to run
   command.CommandText = sql;
   // Run the query
   command.ExecuteNonQuery();
  }
 }

 public override void SetSession(ISession sessionLocal)
 {
  session = sessionLocal;
 }
}
&lt;/pre&gt;


Now your interceptor is ready. So if you would like to set your deadlock priority to High (ie.. SET DEADLOCK_PRIORITY HIGH), then just use following single line of code shown below:&lt;br/&gt;

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;

ISession session = sessionFactory.OpenSession(new DeadLockPriorityInterceptor(&quot;HIGH&quot;));
session.BeginTransaction()

&lt;/pre&gt;

This is how it works&lt;br/&gt;&lt;br/&gt;
1. sessionFactory.OpenSession will pass the interceptor to session.&lt;br/&gt;
2. OpenSession() verifies if there are any interceptors defined in this case it will be &quot;DeadLockPriorityInterceptor&quot;.&lt;br/&gt;
3. Executes SetSession() as it is overridden by an interceptor.&lt;br/&gt;
4. session.BeginTransaction() will start the transaction.&lt;br/&gt;
5. BeginTransaction() verifies if an interceptor is defined by OpenSession().&lt;br/&gt;
6. Executes AfterTransactionBegin() as it is overridden by an interceptor.&lt;br/&gt;

&lt;br/&gt;
That&#39;s it. NHibernate offers various interceptor points which will become quite handy at times.&lt;br/&gt;&lt;br/&gt;

&lt;i&gt;
“Simplicity, carried to the extreme, becomes elegance.”
– Jon Franklin
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/6115538259917834540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/04/set-deadlock-priority-with-nhibernate.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6115538259917834540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6115538259917834540'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/04/set-deadlock-priority-with-nhibernate.html' title='Set deadlock priority with NHibernate'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-8319232781864317132</id><published>2013-04-24T06:00:00.000-07:00</published><updated>2013-04-24T06:03:34.009-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FluentNHibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="NHibernate"/><title type='text'>CompositeId() throws exception - Could not compile the mapping document: (XmlDocument)</title><content type='html'>After defining a map for composite key &lt;br/&gt;

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;

 CompositeId()
                .KeyProperty(x =&gt; x.title)
                .KeyProperty(x =&gt; x.label);
&lt;/pre&gt;

The following exception is raised when trying to create a composite key &lt;br/&gt;
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
CreateSessionFactory() - Inner exception: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
..
CreateSessionFactory() - Inner exception: Could not compile the mapping document: (XmlDocument)
CreateSessionFactory() - Inner exception: composite-id class must override Equals(): CSharpTechies.Data.Entities.post
&lt;/pre&gt;

This means &quot;post&quot; entity definition should override at least 2 members GetHashCode() and Equals(object obj)

Now here is how code snippet looks

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
public override int GetHashCode()
{
 int hashCode = 0;
 hashCode = hashCode ^ title.GetHashCode() ^ label.GetHashCode();
 return hashCode;
}

public override bool Equals(object obj)
{
 var toCompare = obj as post;
 if (toCompare == null)
 {
  return false;
 }
 return (this.GetHashCode() != toCompare.GetHashCode());
} 
&lt;/pre&gt;

Remember if the entity &quot;post&quot; is referenced elsewhere (ie.. foreign key) then you might get some more exceptions&lt;br/&gt;

&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
CreateSessionFactory() - caught EXCEPTION: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
..
CreateSessionFactory() - Inner exception: Foreign key (FK36342426872A80CB:AuthorPosts [Post_id])) must have same number of columns as the referenced primary key (Post[title, label])
&lt;/pre&gt;

So update reference mapping as 
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
  References(x =&gt; x.Post)
                .Columns(new string[] { &quot;title&quot;, &quot;label&quot; })
                .Not.Update()
                .Not.Insert();
&lt;/pre&gt;
or one-to-many mapping as
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
 HasMany(x =&gt; x.Posts)
                .KeyColumns.Add(&quot;title&quot;)
                .KeyColumns.Add(&quot;label&quot;)
                .Not.LazyLoad()
                .Inverse();
&lt;/pre&gt;
&lt;br&gt;&lt;br&gt;
&lt;i&gt;
“We have to stop optimizing for programmers and start optimizing for users.”
– Jeff Atwood
&lt;/i&gt;
&lt;/br&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/8319232781864317132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/04/compositeid-throws-exception-could-not.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/8319232781864317132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/8319232781864317132'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/04/compositeid-throws-exception-could-not.html' title='CompositeId() throws exception - Could not compile the mapping document: (XmlDocument)'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-3664631734211396056</id><published>2013-04-13T15:11:00.000-07:00</published><updated>2013-04-13T15:11:29.462-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NHibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>The conversion of a varchar data type to a datetime data type resulted in an out-of-range value</title><content type='html'>Have encountered with an sql error after running following sql:&lt;br/&gt;
&lt;pre class=&#39;csharp&#39; name=&#39;code&#39;&gt;
INSERT INTO [Member](FirstName, LastName, CreationDate, LastActivityDate) 
VALUES (&#39;Saif&#39;, &#39;Ikram&#39; , &#39;13/04/2013 22:15:44&#39;, &#39;01/01/1753 00:00:00&#39;)
go
&lt;/pre&gt;
&lt;br/&gt;

&quot;The conversion of a varchar data type to a datetime data type resulted in an out-of-range value&quot;. Actually there is nothing wrong with sql. Now run following sql to see if this works
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
set language british
go
INSERT INTO [Member](FirstName, LastName, CreationDate, LastActivityDate) 
VALUES (&#39;Saif&#39;, &#39;Ikram&#39; , &#39;13/04/2013 22:15:44&#39;, &#39;01/01/1753 00:00:00&#39;)
go
&lt;/pre&gt;
&lt;br/&gt;

Now surprisingly this works, only addition is assigning language to &quot;British&quot;. As I am using NHibernate this still is not acceptable. So I have updated my default language &lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
USE CSharpTechies;
GO
EXEC sp_configure &#39;default language&#39;, 1033 ; 
GO
RECONFIGURE ;
GO
&lt;/pre&gt;
1033 for &quot;British English&quot; as described in msdn &lt;a href=&quot;http://msdn.microsoft.com/en-gb/library/ms190303.aspx&quot;&gt;sys.syslanguages&lt;/a&gt;. But this also failed. The reason was the user that sql is run as. So update the language setting for user&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
EXEC sp_defaultlanguage &#39;saif&#39;, &#39;british&#39;
&lt;/pre&gt;
sql now executes without any error&lt;br/&gt;&lt;br/&gt;

Education makes machines which act like men and produces men who act like machines.  ~Erich Fromm
</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/3664631734211396056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/04/the-conversion-of-varchar-data-type-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/3664631734211396056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/3664631734211396056'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/04/the-conversion-of-varchar-data-type-to.html' title='The conversion of a varchar data type to a datetime data type resulted in an out-of-range value'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-96078610102115659</id><published>2013-04-04T02:45:00.000-07:00</published><updated>2013-04-09T03:36:18.831-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FluentNHibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="NHibernate"/><title type='text'>Consuming return value from stored procedure using NHibernate without mapping</title><content type='html'>After haggling around I have found a solution that works. First I have created a stored procedure as follows:&lt;br/&gt;&lt;br/&gt;

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
CREATE PROCEDURE GETTOTALINCOME
AS 
DECLARE
     @TOTALINCOMECOUNT MONEY;
BEGIN
     SELECT @TOTALINCOMECOUNT = SUM(INVAMOUNT) FROM INVOICE
     RETURN @TOTALINCOMECOUNT;
END;
&lt;/pre&gt;

This is a simple stored procedure that just returns a value. Now lets look at NHibernate code block that can execute the stored procedure and read the return value.&lt;br/&gt;&lt;br/&gt;

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
using (var session = OpenSession())
{
     var query = session.CreateSQLQuery(&quot;EXEC GETTOTALINCOME&quot;);
     object result = query.UniqueResult();
     retVal = Convert.ToInt64(result);
}
&lt;/pre&gt;


I am getting exceptions so I started debugging it and have found &quot;result&quot; is null. I have looked at some articles of using stored procedure, but I do not want to define mapping either FulentNHibernate mapped classes or .hbm configuration. &lt;br/&gt;&lt;br/&gt;

I have looked again into stored procedure definition, NHibernate can read the values that are returned by a &quot;SELECT&quot; statement but not &quot;RETURN&quot;. So I have changed my stored procedure as follows:&lt;br/&gt;&lt;br/&gt;

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
CREATE PROCEDURE GETTOTALINCOME
AS 
DECLARE
     @TOTALINCOMECOUNT MONEY;
BEGIN
     SELECT @TOTALINCOMECOUNT = SUM(INVAMOUNT) FROM INVOICE
     SELECT @TOTALINCOMECOUNT;
END;
&lt;/pre&gt;

Now this works. &lt;br/&gt;&lt;br/&gt;
&lt;i&gt;
“We have to stop optimizing for programmers and start optimizing for users.”
– Jeff Atwood
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/96078610102115659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/04/how-to-get-return-value-from-stored.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/96078610102115659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/96078610102115659'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/04/how-to-get-return-value-from-stored.html' title='Consuming return value from stored procedure using NHibernate without mapping'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-6609247312377807834</id><published>2013-03-25T06:11:00.003-07:00</published><updated>2013-03-25T06:11:59.411-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="TechCipher"/><title type='text'>First Release of TechCipher 0.0.13.2303 Beta</title><content type='html'>First version of &lt;a href=&quot;http://www.techcipher.com/&quot;&gt;TechCipher 0.0.13.2303b&lt;/a&gt; released. TechCipher is for Developers, Technical or Solution Architects. TechCipher helps anyone to explore various technologies available in the market to date. &lt;br/&gt;&lt;br/&gt;

This first public beta release is readonly, you will be able to browse and explore various options.&lt;br/&gt;&lt;br/&gt;

TechCipher on first glance will show 2 sections&lt;br/&gt;
- Type of Applications (An application that has been or can be developed falls into one of these categories)&lt;br/&gt;
- Patterns (List of industrial patterns that are available in various arena&#39;s )&lt;br/&gt;&lt;br/&gt;

Next release will include&lt;br/&gt;&lt;br/&gt;

- User &lt;a href=&quot;http://www.techcipher.com/Account/Login&quot;&gt;Login&lt;/a&gt; via TechCipher, Google, Facebook &lt;br/&gt;
- Allow users to comment on articles or categories&lt;br/&gt;
- Allows users to publish new categories or articles&lt;br/&gt;
&lt;br/&gt;
If you would like to either contribute or provide feedback click on the link &lt;a href=&quot;http://www.techcipher.com/Help/Feedback&quot;&gt;TechCipher&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;

&lt;i&gt;
Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/6609247312377807834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/03/first-release-of-techcipher-00132303.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6609247312377807834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6609247312377807834'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/03/first-release-of-techcipher-00132303.html' title='First Release of TechCipher 0.0.13.2303 Beta'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-8481863096912316180</id><published>2013-01-06T16:43:00.001-08:00</published><updated>2013-01-06T16:47:08.023-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WinRT App"/><category scheme="http://www.blogger.com/atom/ns#" term="XAML"/><title type='text'>Custom splash screen for windows store app</title><content type='html'>Visual Studio 2012 provides various templates for developing windows store app (WinRT apps) such as Blank App, Grid App &amp; Split App. All of these templates allows displaying a splash screen which is nothing but a static image.

Sometimes that will not be the ideal solution so why not design a custom splash screen which shows some progress. So this is how it looks&lt;br/&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL4vhcG3chwgw506AsJWHE4nrkWSz3Any7Q6b20B7vtDPLg1_6eW81aTtyDHqAmSjhXwjF37WjbMKmgt9mdFaln8Laj5yK8xtC7jPbzhZDQ7vrVS5joYbPTnO2P_Fm69twf57rwmcb2X2x/s1600/loadingsplashscreen.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL4vhcG3chwgw506AsJWHE4nrkWSz3Any7Q6b20B7vtDPLg1_6eW81aTtyDHqAmSjhXwjF37WjbMKmgt9mdFaln8Laj5yK8xtC7jPbzhZDQ7vrVS5joYbPTnO2P_Fm69twf57rwmcb2X2x/s400/loadingsplashscreen.png&quot; /&gt;&lt;/a&gt;

&lt;br/&gt;&lt;br/&gt;
Now lets look at the mechanics of this can be done. First create an windows store app by using any of the default templates. Add a new &quot;Blank Page&quot; to you application. Add a grid (with darkgray background) and progressring as shown below :
&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
&lt;Page
    x:Class=&quot;CustomSplashScreenApp.LoadingSplashScreen&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    xmlns:local=&quot;using:TechArchitect&quot;
    xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
    xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
    mc:Ignorable=&quot;d&quot;&gt;

    &lt;Grid Background=&quot;DarkGray&quot; Loaded=&quot;LoadingSplashScreen_Loaded&quot;&gt;
        
        
        &lt;ProgressRing x:Name=&quot;ProgressRing&quot; Foreground=&quot;White&quot; IsActive=&quot;True&quot; MaxHeight=&quot;50&quot; MinHeight=&quot;50&quot; MaxWidth=&quot;80&quot;
            MinWidth=&quot;30&quot; Margin=&quot;668,560,620,234&quot; Width=&quot;78&quot; Height=&quot;74&quot;&gt;            
        &lt;/ProgressRing&gt;
        &lt;TextBlock HorizontalAlignment=&quot;Left&quot; Margin=&quot;294,366,0,0&quot; TextWrapping=&quot;Wrap&quot; Text=&quot;Loading ...&quot; VerticalAlignment=&quot;Top&quot; Height=&quot;36&quot; Width=&quot;877&quot; FontSize=&quot;20&quot; Name=&quot;lblProgress&quot;/&gt;
    &lt;/Grid&gt;
&lt;/Page&gt;
&lt;/pre&gt;

In this sample I would like to initialize some data before actually displaying main page and also would like to show user what&#39;s being done during initialization such as:&lt;br/&gt;&lt;br/&gt; 

Connecting to database ....&lt;br/&gt;
Populating data ....&lt;br/&gt;
Initialisation Completed.&lt;br/&gt;&lt;br/&gt;

So I have used DispatcherTimer. look at the code below:-

&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 public sealed partial class LoadingSplashScreen : Page
    {
        internal bool dismissed = false; // Variable to track splash screen dismissal status.
        private SplashScreen splash;
        internal Frame rootFrame;

        public LoadingSplashScreen(SplashScreen splashscreen, bool loadState)
        {
            this.InitializeComponent();
            lblProgress.Text = &quot;Loading ....&quot;;
            if (splash != null)
            {
                // Register an event handler to be executed when the splash screen has been dismissed.
                splash.Dismissed += new TypedEventHandler&lt;SplashScreen, Object&gt;(DismissedEventHandler);
            }
            rootFrame = new Frame();
        }

        // Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application&#39;s first view).
        void DismissedEventHandler(SplashScreen sender, object e)
        {
            dismissed = true;

            // Navigate away from the app&#39;s extended splash screen after completing setup operations here...
            // This sample navigates away from the extended splash screen when the &quot;Learn More&quot; button is clicked.
        }

        DispatcherTimer dispatcherTimer;
        int timesTicked = 1;

        public void DispatcherTimerSetup()
        {
            dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
            //IsEnabled should now be true after calling start
            lblProgress.Text = &quot;Connecting to database ....&quot;;
        }

        void dispatcherTimer_Tick(object sender, object e)
        {
            DateTimeOffset time = DateTimeOffset.Now;
            timesTicked++;
            if (timesTicked == 2)
            {
                lblProgress.Text = &quot;Populating data ....&quot;;
            }

            if (timesTicked == 4)
            {
                lblProgress.Text = &quot;Initialisation Completed&quot;;
                dispatcherTimer.Stop();                               
                rootFrame.Navigate(typeof(ItemsPage), &quot;AllGroups&quot;);
                // Place the frame in the current Window 
                Window.Current.Content = rootFrame;
            }
        }

        void LoadingSplashScreen_Loaded(object sender, RoutedEventArgs e)
        {
            DispatcherTimerSetup();
        }

        /// &lt;summary&gt;
        /// Invoked when this page is about to be displayed in a Frame.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;e&quot;&gt;Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.&lt;/param&gt;
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

        }
    }
&lt;/pre&gt;

So far we have designed and coded custom splash screen. Now here are the steps that will show this custom splash screen&lt;br/&gt;&lt;br/&gt;

1. create a new image with the color filled with darkgray and save it to assets folder as &quot;splashscreen2.png&quot;&lt;br/&gt;&lt;br/&gt;
2. using &quot;Package.appxmanifest&quot; assign splash screen properties as&lt;br/&gt;&lt;br/&gt;
background : darkGray&lt;br/&gt;
image : assests\splashscreen2.png
&lt;br/&gt;&lt;br/&gt;
3. Edit code-behind for App.xaml as follows:&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 protected override async void OnLaunched(LaunchActivatedEventArgs args)
        {
            Frame rootFrame = Window.Current.Content as Frame; 
if (args.PreviousExecutionState != ApplicationExecutionState.Running)
            {
                bool loadState = (args.PreviousExecutionState == ApplicationExecutionState.Terminated);
                LoadingSplashScreen loadingSplashScreen = new LoadingSplashScreen(args.SplashScreen, loadState);
                Window.Current.Content = loadingSplashScreen;
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }
&lt;/pre&gt;

&lt;br/&gt;
All done.
&lt;br/&gt;
&lt;i&gt;
Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important.
- Bill Gates &lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/8481863096912316180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2013/01/custom-splash-screen-for-windows-store.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/8481863096912316180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/8481863096912316180'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2013/01/custom-splash-screen-for-windows-store.html' title='Custom splash screen for windows store app'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-1771486054013667636</id><published>2012-12-04T02:04:00.000-08:00</published><updated>2012-12-04T02:04:45.112-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Active Directory"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Find if user is member of Active Directory Group C#</title><content type='html'>Finding out if user is a member of Active Directory Group can be done using following snippet of code &lt;br/&gt;&lt;br/&gt;

Method 1: using PrincipalContext&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
public static bool IsGroupMember(string domain, string group, string login)
        {
            bool result = false;
            PrincipalContext context = new PrincipalContext(ContextType.Domain, domain);
            UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(context, login);
            GroupPrincipal groupPrincipal = GroupPrincipal.FindByIdentity(context, group);
            if (userPrincipal != null)
            {
                if (userPrincipal.IsMemberOf(groupPrincipal))
                {
                    result = true;
                }
            }
            return result;
        }
&lt;/pre&gt;
Note: This is easy to use but only works based on specific domain&lt;br/&gt;&lt;br/&gt;


Method 2:using DirectoryEntry &lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 public static bool IsGroupMember(Logger logger, string group, string userName)
        {
            string strSid;
            bool result = false;
            clsLookupAccountName.GetAccountSid(userName, out strSid);
            DirectoryEntry rootDSE = new DirectoryEntry(&quot;GC://RootDSE&quot;);
            string rootDomainNamingContext = rootDSE.Properties[&quot;rootDomainNamingContext&quot;].Value.ToString();
            string filter = &quot;(&amp;(objectCategory=user)(objectSid=&quot; + strSid + &quot;))&quot;;
            DirectorySearcher searcher = new DirectorySearcher(&quot;GC://&quot; + rootDomainNamingContext);
            searcher.Filter = filter;
            searcher.PropertiesToLoad.Clear();
            searcher.PropertiesToLoad.Add(&quot;distinguishedName&quot;);
            SearchResult sr = searcher.FindOne();
            string userDN = sr.Properties[&quot;distinguishedName&quot;][0].ToString();
            DirectoryEntry groupEntry = new DirectoryEntry(group);
            PropertyValueCollection pvc = groupEntry.Properties[&quot;member&quot;];

            result = pvc.Contains(userDN);
            return result;
        }   
&lt;/pre&gt;
Note: This requires you to understand AD objects and its properties. Allows you to search universally&lt;br/&gt;&lt;br/&gt;

&lt;i&gt;It has become appallingly obvious that our technology has exceeded our humanity. 
Albert Einstein &lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/1771486054013667636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/12/find-if-user-is-member-of-active.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/1771486054013667636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/1771486054013667636'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/12/find-if-user-is-member-of-active.html' title='Find if user is member of Active Directory Group C#'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-3565550779334833490</id><published>2012-11-28T05:45:00.000-08:00</published><updated>2013-12-17T01:13:05.436-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="KnockoutJs"/><category scheme="http://www.blogger.com/atom/ns#" term="SignalR"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF"/><title type='text'>Combining ASP.NET MVC + SignalR + KnockoutJs with WCF Dual HTTP service</title><content type='html'>Managing windows services for a server via a website seems like a good option instead of having to remote desktop or remote accessing services. &lt;br/&gt;&lt;br/&gt;


A simple ASP.NET website should suffice this requirement, Is that correct ?&lt;br/&gt;
No, here is a simple scenario to prove that. &lt;br/&gt;&lt;br/&gt;

User wants to start a windows service using the website, now there are many things that can go wrong :&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;Service taking longer time to process the request&lt;/li&gt;
&lt;li&gt;Service was unable to start due to some failure&lt;/li&gt;
&lt;li&gt;Users display shows invalid service state&lt;/li&gt;
&lt;/ul&gt;&lt;br/&gt;
To fix this issue polling every 10(sec) can be done to find the correct state of the service. But what if this clients polling be replaced with service polling only when the state of the service is changed.&lt;br/&gt; &lt;br/&gt; 

Now lets dig deep into and find out how this can be done. First lets look at the architecture of &quot;OnlineServiceManagement&quot;&lt;br/&gt; &lt;br/&gt; 
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzOaBCBPmfqY_M_4tJ1SiRnLQTesgyniO0z0GhUb_eUrEhygzHoCZfuZiWXh1cT5BLY7fHxlhrlGUQmrGVYI_Jva12OTM2JahNhmyzclnebhu17YZJTF0fCKhkj4o2e0nX-yOXdo86Hx_o/s1600/Archictecture.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;386&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzOaBCBPmfqY_M_4tJ1SiRnLQTesgyniO0z0GhUb_eUrEhygzHoCZfuZiWXh1cT5BLY7fHxlhrlGUQmrGVYI_Jva12OTM2JahNhmyzclnebhu17YZJTF0fCKhkj4o2e0nX-yOXdo86Hx_o/s400/Archictecture.png&quot; /&gt;&lt;/a&gt;

&lt;br/&gt;
OnlineServiceManagement has got 2 parts&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;WCF Window service with Dual HTTP binding enabled&lt;/li&gt;
&lt;li&gt;ASP.NET MVC website with SignalR and KnockoutJS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;WCF Window service with Dual HTTP binding enabled&lt;/h2&gt;
&lt;i&gt;Note - This application uses nlog for logging&lt;/i&gt;&lt;br/&gt;
First define contracts at least one that has dual binding enabled&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 [ServiceContract]
    public interface IWinServiceNotificationHandler
    {
        [OperationContract(IsOneWay = true)]
        void ServiceStatusChanged(String ServiceName);
    }

     [ServiceContract(
        Name = &quot;WinServiceProviderService&quot;,
        SessionMode = SessionMode.Required,
        CallbackContract = typeof(IWinServiceNotificationHandler))]
    public interface IWinServiceProvider
    {
        [OperationContract]
        string Ping();

        [OperationContract]
        ServiceControllerStatus GetServiceStatus(String Identification, String ServiceName);

        [OperationContract]
        ServiceControllerStatus StartService(String Identification, String ServiceName);

        [OperationContract]
        ServiceControllerStatus StopService(String Identification, String ServiceName);

        [OperationContract]
        ServiceControllerStatus RestartService(String Identification, String ServiceName);
    }
&lt;/pre&gt;
&lt;br/&gt;
Now implement contract behaviour  
&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerCall)]
    public class WinServiceProvider : IWinServiceProvider
    {
        private static List&lt;IWinServiceNotificationHandler&gt; _callbackList = new List&lt;IWinServiceNotificationHandler&gt;();
        private static Dictionary&lt;string, ServiceControllerStatus&gt; _services = new Dictionary&lt;string, ServiceControllerStatus&gt;();
        public static readonly object _locker_ = new object();

        public string Ping()
        {
            return &quot;I can ping&quot;;
        }

        private void RegisterClient(String Identification)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name + &quot;Identifiction as &#39;&quot; + Identification + &quot;&#39;&quot;);
            // Subscribe the guest to the beer inventory
            IWinServiceNotificationHandler client = OperationContext.Current.GetCallbackChannel&lt;IWinServiceNotificationHandler&gt;();
            if (!_callbackList.Contains(client))
            {
                _callbackList.Add(client);
            }
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }

        private void RegisterServiceNames(String ServiceName, ServiceControllerStatus Status)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name + &quot;for Service &#39;&quot; + ServiceName + &quot;&#39;&quot;);

            if (!_services.ContainsKey(ServiceName))
            {
                _services.Add(ServiceName, Status);
            }
            else
            {
                _services[ServiceName] = Status;
            }

            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }

        public static void ResetStatuses()
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            try
            {
                lock (_locker_)
                {
                    string[] serviceNames = _services.Keys.ToArray();
                    foreach (string serviceName in serviceNames)
                    {
                        ServiceController sc = ServiceController.GetServices().Where(s =&gt; s.ServiceName == serviceName).FirstOrDefault();
                        _services[serviceName] = sc.Status;
                    }
                }
            }
            catch (Exception ex)
            {
                ServiceLogger.Logger.Error(ex);
            }
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }

        public static void NotifyClients(String ServiceName)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            ServiceLogger.Logger.Info(&quot;Found {0} callback clients&quot;, _callbackList.Count);
            try
            {
                _callbackList.ForEach(
                    delegate(IWinServiceNotificationHandler callback)
                    { callback.ServiceStatusChanged(ServiceName); });

                ResetStatuses();
            }
            catch (Exception ex)
            {
                ServiceLogger.Logger.ErrorException(&quot;Exception&quot;, ex);
            }
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }

        public static string HasServiceStatusChanged()
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            string retStatusChanged = string.Empty;
            try
            {
                lock (_locker_)
                {
                    string[] serviceNames = _services.Keys.ToArray();
                    foreach (string serviceName in serviceNames)
                    {
                        ServiceController sc = ServiceController.GetServices().Where(s =&gt; s.ServiceName == serviceName).FirstOrDefault();
                        if (sc != null)
                        {
                            if (_services[serviceName] != sc.Status)
                            {
                                ServiceLogger.Logger.Info(&quot;Status changed for &#39;{0}&#39;&quot;, serviceName);
                                retStatusChanged = serviceName;
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ServiceLogger.Logger.Error(ex);
            }
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retStatusChanged;
        }

        public ServiceControllerStatus GetServiceStatus(String Identification, String ServiceName)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name + &quot;Identifiction as &#39;&quot; + Identification + &quot;&#39;&quot;);
            RegisterClient(Identification);
            ServiceControllerStatus retStatus = ServiceControllerStatus.StopPending;
            ServiceController sc = ServiceController.GetServices().Where(s =&gt; s.ServiceName == ServiceName).FirstOrDefault();
            if (sc != null)
            {
                retStatus = sc.Status;
            }
            RegisterServiceNames(ServiceName, sc.Status);
            //NotifyClients(ServiceName);
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retStatus;
        }

        public ServiceControllerStatus StartService(String Identification, String ServiceName)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name + &quot;Identifiction as &#39;&quot; + Identification + &quot;&#39;&quot;);
            RegisterClient(Identification);
            ServiceControllerStatus retStatus = ServiceControllerStatus.StopPending;
            ServiceController sc = ServiceController.GetServices().Where(s =&gt; s.ServiceName == ServiceName).FirstOrDefault();
            if (sc != null)
            {
                sc.Start();
                retStatus = sc.Status;
                //while (retStatus != ServiceControllerStatus.Running)
                //{
                //    System.Threading.Thread.Sleep(1000);
                //}
            }
            RegisterServiceNames(ServiceName, sc.Status);
            //NotifyClients(ServiceName);
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retStatus;
        }

        public ServiceControllerStatus StopService(String Identification, String ServiceName)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name + &quot;Identifiction as &#39;&quot; + Identification + &quot;&#39;&quot;);
            RegisterClient(Identification);
            ServiceControllerStatus retStatus = ServiceControllerStatus.StopPending;
            ServiceController sc = ServiceController.GetServices().Where(s =&gt; s.ServiceName == ServiceName).FirstOrDefault();
            if (sc != null)
            {
                sc.Stop();
                retStatus = sc.Status;
                //while (retStatus != ServiceControllerStatus.Stopped)
                //{
                //    System.Threading.Thread.Sleep(1000);
                //}
            }
            RegisterServiceNames(ServiceName, sc.Status);
            //NotifyClients(ServiceName);
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retStatus;
        }

        public ServiceControllerStatus RestartService(String Identification, String ServiceName)
        {
            ServiceLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name + &quot;Identifiction as &#39;&quot; + Identification + &quot;&#39;&quot;);
            RegisterClient(Identification);
            ServiceControllerStatus retStatus = ServiceControllerStatus.StopPending;
            ServiceController sc = ServiceController.GetServices().Where(s =&gt; s.ServiceName == ServiceName).FirstOrDefault();
            if (sc != null)
            {
                retStatus = StopService(Identification, ServiceName);
                retStatus = StartService(Identification, ServiceName);
            }
            RegisterServiceNames(ServiceName, sc.Status);
            //NotifyClients(ServiceName);
            ServiceLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retStatus;
        }
    }
&lt;/pre&gt;

Now define endpoint configuration in app.config for windows service&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
endpoint address=&quot;&quot; binding=&quot;wsDualHttpBinding&quot;                  contract=&quot;WinServiceManger.Contract.IWinServiceProvider&quot; 
&lt;/pre&gt;
&lt;br/&gt;

That&#39;s it main components of windows service are completed. Windows service exposes some operations for website consumption and also has &quot;IWinServiceNotificationHandler&quot; for implementing call back to clients.

&lt;h2&gt;ASP.NET MVC website with SignalR and KnockoutJS&lt;/h2&gt;

Using the default MVC template for creating the project should be sufficient. Now lets look into the details of website. Include following dependencies :&lt;br/&gt;
&lt;b&gt;Dlls&lt;/b&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;SignalR&lt;/li&gt;
&lt;li&gt;NLog&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;b&gt;Scripts&lt;/b&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;JQuery&lt;/li&gt;
&lt;li&gt;JQuery Templates Plugin&lt;/li&gt;
&lt;li&gt;KnockoutJS&lt;/li&gt;
&lt;li&gt;Json&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;b&gt;Service references&lt;/b&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;WinServiceManger&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;&lt;br/&gt;

We are using KnockoutJS that follows MVVM pattern in which Model comes first. So lets define our &lt;b&gt;Model&lt;/b&gt; first

&lt;pre class=&quot;html&quot; name=&quot;code&quot;&gt;
public class WindowsServicesModel
    {
        public List&lt;WinService&gt; Services { get; set; }
        public WindowsServicesModel(String Identification)
        {
            LoadServices(Identification);
        }

        private void LoadServices(String Identification)
        {
            try
            {
                Services = new List&lt;WinService&gt;()
                {
                    new WinService
                    {
                        Name = &quot;ASP.NET State Service&quot;,
                        ServiceName = &quot;aspnet_state&quot;,
                        Description=&quot;Provides support for out-of-process session states for ASP.NET. If this service is stopped, out-of-process requests will not be processed. If this service is disabled, any services that explicitly depend on it will fail to start.&quot;,
                        CSSClass = &quot;one&quot;,
                        Status= &quot;&quot;
                    },
                    new WinService
                    {
                        Name = &quot;Background Intelligent Transfer Service&quot;,
                        ServiceName = &quot;BITS&quot;,
                        Description=&quot;Transfers files in the background using idle network bandwidth. If the service is disabled, then any applications that depend on BITS, such as Windows Update or MSN Explorer, will be unable to automatically download programs and other information.&quot;,
                        CSSClass = &quot;two&quot;,
                        Status= &quot;&quot;
                    },
                    new WinService
                    {
                        Name = &quot;Bluetooth Support Service&quot;,
                        ServiceName = &quot;bthserv&quot;,
                        Description=&quot;The Bluetooth service supports discovery and association of remote Bluetooth devices.  Stopping or disabling this service may cause already installed Bluetooth devices to fail to operate properly and prevent new devices from being discovered or associated.&quot;,
                        CSSClass = &quot;three&quot;,
                        Status= &quot;&quot;
                    }
                };

                foreach (WinService winService in Services)
                {
                    WinServiceManger.ServiceControllerStatus status = Global.WinServiceMangerClient.GetServiceStatus(Identification, winService.ServiceName);
                    switch (status)
                    {
                        case WinServiceManger.ServiceControllerStatus.Running:
                            winService.Status = &quot;Running&quot;;
                            break;
                        case WinServiceManger.ServiceControllerStatus.ContinuePending:
                            winService.Status = &quot;Continue Pending&quot;;
                            break;
                        case WinServiceManger.ServiceControllerStatus.Paused:
                            winService.Status = &quot;Paused&quot;;
                            break;
                        case WinServiceManger.ServiceControllerStatus.PausePending:
                            winService.Status = &quot;Pause Pending&quot;;
                            break;
                        case WinServiceManger.ServiceControllerStatus.StartPending:
                            winService.Status = &quot;Start Pending&quot;;
                            break;
                        case WinServiceManger.ServiceControllerStatus.Stopped:
                            winService.Status = &quot;Stopped&quot;;
                            break;
                        default:
                            winService.Status = &quot;Unknown&quot;;
                            break;
                    }
                }
            }
            catch (Exception ex)
            {
                WebLogger.Logger.ErrorException(&quot;WindowsServicesModel.LoadServices Exception : &quot;, ex);
            }
        }
    }
&lt;/pre&gt;

We have our model ready now, so lets define our &lt;b&gt;View&lt;/b&gt; to be a KnockoutJS template that display list of services available.&lt;br/&gt;

&lt;pre class=&quot;html&quot; name=&quot;code&quot;&gt;
 &lt;div data-bind=&quot;template: {name:&#39;Services-Template&#39;, foreach: Services}&quot;&gt;&lt;/div&gt;
    &lt;script type=&quot;text/html&quot; id=&quot;Services-Template&quot;&gt;
        &lt;% Html.BeginForm(&quot;Index&quot;, &quot;Home&quot;, FormMethod.Post); %&gt;           
             &lt;ol class=&quot;round&quot;&gt;
                    &lt;li data-bind=&quot;attr:{class:CSSClass}&quot;&gt;  
                    &lt;h5 data-bind=&quot;text:Name&quot;&gt;&lt;/h5&gt;
                    &lt;span data-bind=&quot;text:Description&quot;&gt;&lt;/span&gt;
                    &lt;p&gt;
                        &lt;span data-bind=&quot;text:Status&quot;&gt;&lt;/span&gt;
                    &lt;/p&gt;
                    &lt;p&gt;
                        &lt;span data-bind=&quot;attr: {id: ServiceName}&quot;&gt;&lt;/span&gt;
                    &lt;/p&gt;
                    &lt;p&gt;
                        &lt;button data-bind=&quot;click: koHelper.StartService&quot;&gt;Start&lt;/button&gt;
                        &lt;button data-bind=&quot;click: koHelper.StopService&quot;&gt;Stop&lt;/button&gt;
                        &lt;button data-bind=&quot;click: koHelper.RestartService&quot;&gt;Restart&lt;/button&gt;                       
                    &lt;/p&gt;
                    &lt;/li&gt;
            &lt;/ol&gt;
        &lt;% Html.EndForm();%&gt;
    &lt;/script&gt;
&lt;/pre&gt;

Now write javascript code for updating &lt;b&gt;View&lt;/b&gt; that is defined earlier
&lt;pre class=&quot;html&quot; name=&quot;code&quot;&gt;
var koHelper = {
    ViewModel: {},
    LoadViewModel: function (resultData) {
        //var strViewModel = document.getElementById(viewModelFieldId).value;
        //var clientViewModel = ko.utils.parseJson(resultData);
        var clientViewModel = resultData;
        this.ViewModel = clientViewModel;
        ko.applyBindings(this.ViewModel);
    },
    getWindowsServices: function () {
        $.ajax({
            url: &quot;/Home/GetWindowsServices/&quot;,
            type: &#39;post&#39;,
            //data: &quot;{&#39;customerID&#39;:&#39;1&#39; }&quot;,
            contentType: &#39;application/json&#39;,
            success: function (result) {
                koHelper.LoadViewModel(result);
                var dt = new Date();
                koHelper.UpdateStatus(&quot;Autoupdate service status by Signal-R&quot;);
            },
            error: function (jqXHR, textStatus, errorThrown) {
                var errorMessage = &#39;&#39;;
                $(&#39;#message&#39;).html(jqXHR.responseText);
            }
        });
    },
    StartService: function (data, event) {        
        $.ajax({
            url: &quot;/Home/StartService/&quot;,
            type: &#39;post&#39;,
            data: JSON.stringify( { &#39;ServiceName&#39;: data.ServiceName } ),
            contentType: &#39;application/json&#39;,
            dataType: &#39;json&#39;,
            success: function (result) {
                if (result != null) {
                    koHelper.LoadViewModel(result);
                    var dt = new Date();
                    koHelper.UpdateStatus(&quot;StartService&quot;);
                    //$.windowsServiceManager.performedServiceStatusChange(data.ServiceName);
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                var errorMessage = &#39;&#39;;
                $(&#39;#message&#39;).html(jqXHR.responseText);
            }
        });
    },
    StopService: function (data, event) {
        $.ajax({
            url: &quot;/Home/StopService/&quot;,
            type: &#39;post&#39;,
            data: JSON.stringify({ &#39;ServiceName&#39;: data.ServiceName }),
            contentType: &#39;application/json&#39;,
            dataType: &#39;json&#39;,
            success: function (result) {
                if (result != null) {
                    koHelper.LoadViewModel(result);
                    var dt = new Date();
                    koHelper.UpdateStatus(&quot;StopService&quot;);
                    //$.windowsServiceManager.performedServiceStatusChange(data.ServiceName);
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                var errorMessage = &#39;&#39;;
                $(&#39;#message&#39;).html(jqXHR.responseText);
            }
        });
    },
    RestartService: function (data, event) {
        $.ajax({
            url: &quot;/Home/RestartService/&quot;,
            type: &#39;post&#39;,
            data: JSON.stringify({ &#39;ServiceName&#39;: data.ServiceName }),
            contentType: &#39;application/json&#39;,
            dataType: &#39;json&#39;,
            success: function (result) {
                if (result != null) {
                    koHelper.LoadViewModel(result);
                    var dt = new Date();
                    koHelper.UpdateStatus(&quot;RestartService&quot;);
                    //$.windowsServiceManager.performedServiceStatusChange(data.ServiceName);
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                var errorMessage = &#39;&#39;;
                $(&#39;#message&#39;).html(jqXHR.responseText);
            }
        });
    },
    UpdateStatus: function (statusData) {
        var content = &quot;&lt;/br&gt;&quot; + new Date() + &quot;&lt;/br&gt;&quot; + statusData + &quot;&lt;/br&gt;&quot;;
        content += $(&#39;#statusInfo&#39;).html() ;
        $(&#39;#statusInfo&#39;).html(content);
    }
}
&lt;/pre&gt;

We have used following controller actions:-
&lt;ul&gt;
&lt;li&gt;/Home/GetWindowsServices/&lt;/li&gt;
&lt;li&gt;/Home/StartService/&lt;/li&gt;
&lt;li&gt;/Home/StopService/&lt;/li&gt;
&lt;li&gt;/Home/RestartService/&lt;/li&gt;
&lt;/ul&gt;

Now lets look at implementing these actions
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 public JsonResult GetWindowsServices()
        {
            JsonResult retValue = null;
            WebLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            try
            {
                if (Session[&quot;Identification&quot;] != null)
                {
                    WindowsServicesModel wsm = new WindowsServicesModel(Session[&quot;Identification&quot;].ToString());
                    retValue = new JsonResult()
                    {
                        Data = wsm
                    };
                }
            }
            catch (Exception ex)
            {
                WebLogger.Logger.ErrorException(&quot;Error &quot;, ex);
            }
            WebLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retValue;
        }

[AcceptVerbs(HttpVerbs.Post)]
        public JsonResult StartService(string ServiceName)
        {
            JsonResult retValue = null;
            WebLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            try
            {
                if (Session[&quot;Identification&quot;] != null)
                {
                    WinServiceManger.ServiceControllerStatus status = Global.WinServiceMangerClient.StartService(Session[&quot;Identification&quot;].ToString(), ServiceName);
                    //if (status == WinServiceManger.ServiceControllerStatus.Running)
                    //{
                    WindowsServicesModel wsm = new WindowsServicesModel(Session[&quot;Identification&quot;].ToString());
                    retValue = new JsonResult()
                    {
                        Data = wsm
                    };
                    //}
                }
            }
            catch (Exception ex)
            {
                WebLogger.Logger.ErrorException(&quot;Error &quot;, ex);
            }
            WebLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retValue;
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public JsonResult StopService(string ServiceName)
        {
            JsonResult retValue = null;
            WebLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            try
            {
                WinServiceManger.ServiceControllerStatus status = Global.WinServiceMangerClient.StopService(Session[&quot;Identification&quot;].ToString(), ServiceName);
                WindowsServicesModel wsm = new WindowsServicesModel(Session[&quot;Identification&quot;].ToString());
                retValue = new JsonResult()
                {
                    Data = wsm
                };
            }
            catch (Exception ex)
            {
                WebLogger.Logger.ErrorException(&quot;Error &quot;, ex);
            }
            WebLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retValue;
        }

        [AcceptVerbs(HttpVerbs.Post)]
        public JsonResult RestartService(string ServiceName)
        {
            JsonResult retValue = null;
            WebLogger.Logger.Info(&quot;Started &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            try
            {
                WinServiceManger.ServiceControllerStatus status = Global.WinServiceMangerClient.RestartService(Session[&quot;Identification&quot;].ToString(), ServiceName);
                //if (status == WinServiceManger.ServiceControllerStatus.Running)
                //{
                WindowsServicesModel wsm = new WindowsServicesModel(Session[&quot;Identification&quot;].ToString());
                retValue = new JsonResult()
                {
                    Data = wsm
                };
                //}
            }
            catch (Exception ex)
            {
                WebLogger.Logger.ErrorException(&quot;Error &quot;, ex);
            }
            WebLogger.Logger.Info(&quot;Completed &quot; + System.Reflection.MethodInfo.GetCurrentMethod().Name);
            return retValue;
        }
&lt;/pre&gt;

Thats it! we are done with main components required for implementing our requirement. Complete solution is available on GitHub at &lt;strike&gt;&lt;a href=&quot;https://github.com/saifmd4u/csharptechies/tree/master/OnlineServiceManagement&quot;&gt;OnlineServiceManagement&lt;/a&gt;&lt;/strike&gt;
&lt;a href=&quot;https://github.com/saifmd4u/OnlineServiceManagement&quot;&gt;OnlineServiceManagement&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;

&lt;i&gt;
“We have to stop optimizing for programmers and start optimizing for users.”
– Jeff Atwood
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/3565550779334833490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/11/combining-aspnet-mvc-signalr-knockoutjs.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/3565550779334833490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/3565550779334833490'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/11/combining-aspnet-mvc-signalr-knockoutjs.html' title='Combining ASP.NET MVC + SignalR + KnockoutJs with WCF Dual HTTP service'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzOaBCBPmfqY_M_4tJ1SiRnLQTesgyniO0z0GhUb_eUrEhygzHoCZfuZiWXh1cT5BLY7fHxlhrlGUQmrGVYI_Jva12OTM2JahNhmyzclnebhu17YZJTF0fCKhkj4o2e0nX-yOXdo86Hx_o/s72-c/Archictecture.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-520757730115158280</id><published>2012-11-20T04:52:00.000-08:00</published><updated>2012-11-20T04:52:30.206-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="VS 2010"/><title type='text'>Unable to share user controls as a link between projects in ASP.NET</title><content type='html'>Sharing user control as a link between project is not advisable as per microsoft article &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/9f4t9t92(v=vs.80).aspx&quot;&gt;How to: Add Existing Items to a Project&lt;/a&gt;. Look at note under &quot;Adding an Existing Item as a Link&quot; as it says &lt;/br&gt;&lt;/br&gt;

&quot;Visual Basic Web projects, Visual C# Web projects, and other similar projects do not support links to items.&quot;&lt;/br&gt;&lt;/br&gt;

But if you still want to go with this method, then here it is how you can achieve it. Consider you have following projects in your solution&lt;/br&gt;
- Web application 1 =&gt; csharpbloggerapp.csproj &lt;/br&gt;
- Web application 2 =&gt; csharpblogtracker.csproj &lt;/br&gt;
- a deployment project for web app csharpbloggerapp.deploy.csproj (for csharpbloggerapp.csproj)&lt;/br&gt;&lt;/br&gt;

Now consider you have a script csharpcomm.js inside csharpblogtracker.csproj under script folder and would like to include this into csharpbloggerapp.csproj not as another file but as a link, so making changes/fixes/enhancements will be easy.&lt;/br&gt;&lt;/br&gt;

1. First go to &quot;scripts&quot; folder inside csharpbloggerapp.csproj, then right click on &quot;Scripts&quot; folder select &quot;Add Existing Item&quot; , browse to csharpblogtracker-&gt;scripts and select the file csharpcomm.js&lt;/br&gt;
2. Now from the Open button drop-down list, select Add As Link&lt;/br&gt;&lt;/br&gt;

After adding the link, compile your deploy project and you shall notice &quot;csharpcomm.js&quot; has not been copied.&lt;/br&gt;&lt;/br&gt;

3. Now add a &quot;Post Build Event&quot; for csharpbloggerapp.csproj as follows&lt;/br&gt;&lt;/br&gt;

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
xcopy /y $(ProjectDir)$(OutDir)..\..\csharpblogtracker\Scripts\csharpcomm.js $(ProjectDir)$(OutDir)..\Scripts
&lt;/pre&gt;

That&#39;s it... now compile your deployment project and you should find csharpcomm.js copied. Same procedure can be used for pages, user controls, resource files etc..&lt;/br&gt;&lt;/br&gt;

But correct method is to create a common assembly and add reference to this common library.&lt;/br&gt;&lt;/br&gt;

&lt;i&gt;
“We have to stop optimizing for programmers and start optimizing for users.”
– Jeff Atwood&lt;/i&gt;


</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/520757730115158280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/11/unable-to-share-user-controls-as-link.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/520757730115158280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/520757730115158280'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/11/unable-to-share-user-controls-as-link.html' title='Unable to share user controls as a link between projects in ASP.NET'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-7072967164094907411</id><published>2012-10-03T05:56:00.000-07:00</published><updated>2012-10-18T07:53:12.543-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="DevExpress"/><title type='text'>DevExpress Unable to get value of the property &#39;usercontrol_dxcontrol_event&#39; : object is null or undefined</title><content type='html'>I am getting &quot;Microsoft JScript runtime error&quot; when running web application that uses DevExpress controls. 

I have got a user control hierarchy as follows:-
&lt;pre&gt;
Default.aspx
 |
  -&gt; Site.Master
          |
           -&gt; LoadInvoiceTab
                  |
                   -&gt; LoadInvoiceTabHeader
&lt;/pre&gt;
LoadInvoiceTabHeader has got some javascript code to handle client side events for DevExpress controls. script has been added toward end of the user control definition.

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;LoadInvoiceTabHeader.ascx.cs&quot; Inherits=&quot;LoadInvoiceTabHeader&quot; %&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;

    function SaveInvoice(s, e) {
        alert(&#39;Saved&#39;);
    }

    function CancelInvoice(s, e) {
        alert(&#39;Cancelled&#39;);
    }

&lt;/script&gt; 
&lt;table border=&quot;0&quot;&gt;
&lt;tr&gt;
    &lt;td&gt;Invoice No :&lt;/td&gt;
    &lt;td&gt;
         &lt;dx:ASPxTextBox ID=&quot;txtInvoiceNumber&quot; runat=&quot;server&quot; Width=&quot;200px&quot; Enabled=&quot;false&quot;&gt;
         &lt;/dx:ASPxTextBox&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Customer name :&lt;/td&gt;
    &lt;td&gt;
         &lt;dx:ASPxTextBox ID=&quot;txtCustomerName&quot; runat=&quot;server&quot; Width=&quot;200px&quot; Enabled=&quot;false&quot;&gt;
         &lt;/dx:ASPxTextBox&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Delivery Address :&lt;/td&gt;
    &lt;td&gt;
         &lt;dx:ASPxTextBox ID=&quot;txtDeliveryAddress&quot; runat=&quot;server&quot; Width=&quot;200px&quot; Enabled=&quot;false&quot;&gt;
         &lt;/dx:ASPxTextBox&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td colspan=&quot;2&quot; align=&quot;right&quot;&gt;
        &lt;table border=&quot;0&quot;&gt;
           &lt;tr&gt;
                &lt;td&gt;
                    &lt;dx:ASPxButton ID=&quot;btnSave&quot; runat=&quot;server&quot; Text=&quot;Select&quot; ClientInstanceName=&quot;btnSave&quot;
                        AutoPostBack=&quot;false&quot;&gt;  
                        &lt;ClientSideEvents Click=&quot;SaveInvoice&quot; /&gt;                                                  
                    &lt;/dx:ASPxButton&gt;
                &lt;/td&gt;
                &lt;td&gt;
                    &lt;dx:ASPxButton ID=&quot;btnCancel&quot; runat=&quot;server&quot; Text=&quot;Close&quot; ClientInstanceName=&quot;btnCancel&quot;
                        AutoPostBack=&quot;false&quot;&gt;  
                        &lt;ClientSideEvents Click=&quot;CancelInvoice&quot; /&gt;                                                  
                    &lt;/dx:ASPxButton&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt; 
&lt;/pre&gt;
After running the website I was getting following error message:-
&lt;pre&gt;
Microsoft JScript runtime error: Unable to get value of the property &#39;LoadInvoiceTabHeader_btnSave_Click&#39;: object is null or undefined
&lt;/pre&gt;

The reason for the script error is because devexpress controls try to evaluate SaveInvoice &amp; CancelInvoice while rendering the page, but by this time the script written for clientside events were not assigned and hence generates an error.

In order to render the script in advance all you need to do is just assign id for script tab with prefix with &quot;dxss_&quot;. So script will now become

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; id=&quot;dxss_invoiceheader&quot;&gt;

    function SaveInvoice(s, e) {
        alert(&#39;Saved&#39;);
    }

    function CancelInvoice(s, e) {
        alert(&#39;Cancelled&#39;);
    }

&lt;/script&gt; 
&lt;/pre&gt;

That&#39;s it this should solve the issue. &lt;br/&gt;&lt;br/&gt;

&lt;i&gt;One machine can do the work of fifty ordinary men.  No machine can do the work of one extraordinary man.  ~Elbert Hubbard, The Roycroft Dictionary and Book of Epigrams, 1923&lt;/i&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/7072967164094907411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/10/unable-to-get-value-of-property.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/7072967164094907411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/7072967164094907411'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/10/unable-to-get-value-of-property.html' title='DevExpress Unable to get value of the property &#39;usercontrol_dxcontrol_event&#39; : object is null or undefined'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-4184667780166460828</id><published>2012-09-25T16:03:00.000-07:00</published><updated>2012-09-26T06:32:11.538-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fiddler API"/><title type='text'>Measuring performance using Fiddler API</title><content type='html'>
&lt;p&gt;Having used Fiddler as one of the most useful tool as a developer, would it not be easy to actually use Fiddler to measure up website performance, throughput etc. Well!! FiddlerCore API can be used to achieve this. Refer to &lt;a href=&quot;http://fiddler.wikidot.com/fiddlercore&quot;&gt;FiddlerCode API&lt;/a&gt; for some samples.&lt;/p&gt;
&lt;p&gt;
Pretty cool. I have been using DevExpress ASP.NET controls for quite sometime now and I wanted to measure the performance and throughput for some of very interesting controls such as aspxcallbackpanel &amp; aspxcallback.
&lt;/p&gt;
&lt;p&gt;All I want is a small windows app with a single form having a grid that show all of the interactions to and from the website I wanted to test. So here is how it looks when comparing performance against 30 secs max.
&lt;/p&gt;
&lt;p&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Dsq5Q25qL9kvEntOwFyKrawIDy_CED51gT1M48D6CW5D0TNPHo7guBEWU3_UAZEgS0hdjfoJYEFoQzTWOOq5ssvLTcHQnuHcdWihCD8EqVEGwiuq5JHiw6askXC8BZYfbiK95XeFK2rk/s1600/devexpress_1.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Dsq5Q25qL9kvEntOwFyKrawIDy_CED51gT1M48D6CW5D0TNPHo7guBEWU3_UAZEgS0hdjfoJYEFoQzTWOOq5ssvLTcHQnuHcdWihCD8EqVEGwiuq5JHiw6askXC8BZYfbiK95XeFK2rk/s400/devexpress_1.png&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

Steps
1. Initialize and associate all relevant events and flags for Fiddler API. 
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
public Form1()
        {
            InitializeComponent();

            oAllSessions = new List&lt;Fiddler.Session&gt;();
            Fiddler.FiddlerApplication.OnNotification += delegate(object sender, NotificationEventArgs oNEA) { Console.WriteLine(&quot;** NotifyUser: &quot; + oNEA.NotifyString); };
            Fiddler.FiddlerApplication.Log.OnLogString += delegate(object sender, LogEventArgs oLEA) { Console.WriteLine(&quot;** LogString: &quot; + oLEA.LogString); };
            Fiddler.FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oS)
            {
                oS.bBufferResponse = false;
                Monitor.Enter(oAllSessions);
                if (oS.fullUrl.StartsWith(sSecureEndpointHostname))
                {
                    oAllSessions.Add(oS);
                }
                Monitor.Exit(oAllSessions);
            };
            Fiddler.FiddlerApplication.AfterSessionComplete += delegate(Fiddler.Session oS)
            {
                if (bUpdateTitle)
                {
                    this.Text = (&quot;Session list contains: &quot; + oAllSessions.Count.ToString() + &quot; sessions&quot;);
                }
            };
            Fiddler.CONFIG.IgnoreServerCertErrors = false;
            oFCSF = FiddlerCoreStartupFlags.Default;
        }
&lt;/pre&gt;

2. Now write code to handle start/stop monitoring of fiddler sessions
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 private void btnStartStop_Click(object sender, EventArgs e)
        {
            test = new Random(120);
            if (btnStartStop.Text == &quot;Start&quot;)
            {                
                Uri uri = new Uri(txtWebSite.Text);
                iSecureEndpointPort = uri.Port;                
                btnStartStop.Text = &quot;Stop&quot;;
                tmrAnalyse.Enabled = true;
                tmrAnalyse.Interval = 5000;
                sSecureEndpointHostname = uri.AbsoluteUri;

                lstAnalysisData.Items.Clear();
                dgSessions.Rows.Clear();


                Fiddler.FiddlerApplication.Startup(8877, oFCSF);                
            }
            else
            {                
                Fiddler.FiddlerApplication.Shutdown();
                btnStartStop.Text = &quot;Start&quot;;
                tmrAnalyse.Enabled = false;
            }
        }
&lt;/pre&gt;

3. code snippets for add/update session data onto grid
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
private void AddSession(Session oS, Dictionary&lt;string, string&gt; whoData, int timeTaken)
        {
            DataGridViewRow row = new DataGridViewRow();
            dgSessions.Rows.Add(row);

            DataGridViewCell cell1 = new DataGridViewTextBoxCell();
            cell1.Value = oS.id;
            row.Cells[&quot;SessionID&quot;] = cell1;

            DataGridViewCell cell2 = new DataGridViewTextBoxCell();
            cell2.Value = Ellipsize(oS.fullUrl, 60);
            row.Cells[&quot;URL&quot;] = cell2;

            DataGridViewCell cell3 = new DataGridViewTextBoxCell();
            cell3.Value = oS.oRequest.headers.HTTPMethod;
            row.Cells[&quot;HttpMethod&quot;] = cell3;

            DataGridViewCell cell4 = new DataGridViewTextBoxCell();
            cell4.Value = oS.responseCode;
            row.Cells[&quot;RresponseCode&quot;] = cell4;

            DataGridViewCell cell5 = new DataGridViewTextBoxCell();
            cell5.Value = oS.oResponse.MIMEType;
            row.Cells[&quot;MIMEType&quot;] = cell5;

            DataGridViewCell cell6 = new DataGridViewTextBoxCell();
            DataGridViewCell cell7 = new DataGridViewTextBoxCell();
            

            if (whoData.ContainsKey(NotFound))
            {
                cell6.Value = &quot;Not found&quot;;
                cell7.Value = &quot;Not found&quot;;                
            }
            else
            {
                cell6.Value = whoData[DataColumn1];
                cell7.Value = whoData[DataColumn2];
            }

            row.Cells[&quot;Data1&quot;] = cell6;
            row.Cells[&quot;Data2&quot;] = cell7;

            DataGridViewCell cell8 = new DataGridViewTextBoxCell();
            cell8.Value = timeTaken;
            row.Cells[&quot;Data3&quot;] = cell8;

        }

        private int FindRow(Session oS)
        {
            int rowId = -1;
            for (int i = 0; i &lt; dgSessions.Rows.Count; i++)
            {
                DataGridViewRow row = dgSessions.Rows[i];
                if (row.Cells[0].Value != null)
                {
                    if (row.Cells[0].Value.ToString() == oS.id.ToString())
                    {
                        rowId = i;
                        break;
                    }
                }
                else
                {
                    rowId = i;
                    break;
                }
            }
            return rowId;
        }

        private void UpdateSession(int rowId, Session oS, Dictionary&lt;string, string&gt; whoData, int timeTaken)
        {
            DataGridViewRow row = dgSessions.Rows[rowId];
            row.Cells[&quot;SessionID&quot;].Value = oS.id;
            row.Cells[&quot;URL&quot;].Value = Ellipsize(oS.fullUrl, 60);
            row.Cells[&quot;HttpMethod&quot;].Value = oS.oRequest.headers.HTTPMethod;
            row.Cells[&quot;RresponseCode&quot;].Value = oS.responseCode;
            row.Cells[&quot;MIMEType&quot;].Value = oS.oResponse.MIMEType;
            row.Cells[&quot;Data1&quot;].Value = whoData[DataColumn1];
            row.Cells[&quot;Data2&quot;].Value = whoData[DataColumn2];
            row.Cells[&quot;Data3&quot;].Value = timeTaken;
        }
&lt;/pre&gt;

4. code snippet for updating grid every 5 secs
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
private void WriteSessionList()
        {
            try
            {
                Monitor.Enter(oAllSessions);
                foreach (Session oS in oAllSessions)
                {
                    WriteSession(oS);
                }
            }
            catch (Exception ex)
            {
                lstAnalysisData.Items.Add(&quot;Exception &quot; + ex.Message);
            }
            finally
            {
                Monitor.Exit(oAllSessions);
            }
        }

        private void tmrAnalyse_Tick(object sender, EventArgs e)
        {           
            WriteSessionList();
        }
&lt;/pre&gt;

That&#39;s it all in place now. Some of the tiny bits were missed out in the intention highlight more important bits. Download &lt;a href=&quot;https://sites.google.com/site/csharptechies/fidderapi-rar/FidderAPI.rar?attredirects=0&amp;d=1&quot;&gt;FidderAPI.rar&lt;/a&gt; for more details. This is common code and can be used for any website or web applications. Mostly useful to verify throughput/speed  for websites that utilises any of the following controls or JavaScript plugins :-&lt;br /&gt;
- asp:UpdatePanel (ASP.NET ajax control)&lt;br /&gt;
- $.ajax (JQuery ajax call to webservice/webpage)&lt;br /&gt;
- ActionResult  (ASP.NET MVC action) etc.
&lt;br /&gt;&lt;br /&gt;

&lt;i&gt;
Some people worry that artificial intelligence will make us feel inferior, but then, anybody in his right mind should have an inferiority complex every time he looks at a flower.  ~Alan C. Kay
&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/4184667780166460828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/09/measuring-performance-using-fiddler-api.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4184667780166460828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/4184667780166460828'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/09/measuring-performance-using-fiddler-api.html' title='Measuring performance using Fiddler API'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-6964005413489751859</id><published>2012-09-19T06:14:00.000-07:00</published><updated>2012-10-18T07:53:29.011-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="DevExpress"/><title type='text'>DevExpress Input string was not in a correct format</title><content type='html'>
I have started using ASP.NET DevExpress controls  quite some time now. In last couple of days I have seen a strange error on pages with the following error message : &lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;&quot;Input string was not in a correct format&quot; &lt;/b&gt;
&lt;br/&gt;&lt;br/&gt;

Here is what my page consisted of a list of controls&lt;br/&gt;
- ASPxTextBox&lt;br/&gt;
- ASPxComboBox&lt;br/&gt;
- ASPxButton&lt;br/&gt;
- ASPxCallback&lt;br/&gt;
&lt;br/&gt;
I want to pass the input data of ASPxTextBox &amp; ASPxComboBox on button click to server via ASPxCallback and store this information in a database. Not so complicated as it sounds. &lt;br/&gt;&lt;br/&gt;

I have got some Nlog tracing enabled, got try-catch for ASPxCallback and all wired up. Started testing the page and I got this error &quot;&quot;Input string was not in a correct format&quot;&lt;br/&gt;&lt;br/&gt;

Started debugging. No server side exceptions and nothing wrong, do not know where the error is coming from after googling and search in DevExpress support tickets I have found how to enable callback errors.&lt;br/&gt;&lt;br/&gt;

So I have enabled tracing callback errors as mentioned by DevExpress in the article 
&lt;a href=&quot;http://documentation.devexpress.com/#AspNet/CustomDocument8886&quot;&gt;Handling Callback Exceptions on Client&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;

Now I have got the tracing as:-&lt;br/&gt;&lt;br/&gt;

at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal)&lt;br/&gt;
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)&lt;br/&gt;
   at System.Int32.Parse(String s)&lt;br/&gt;
   at DevExpress.Web.ASPxEditors.ListEditItemsSerializingHelper.ParseItemIndex(String serializedItem, Int32&amp; startPos)&lt;br/&gt;
   at DevExpress.Web.ASPxEditors.ListBoxItemsSerializingHelper.DeserializeItems(String serializedItems, Boolean sortRequired)&lt;br/&gt;
   at DevExpress.Web.ASPxEditors.ListBoxProperties.SynchronizeItems(String serializedItems, Boolean isInsertingSyncType)&lt;br/&gt;
   at DevExpress.Web.ASPxEditors.ASPxComboBox.SynchronizeItems(NameValueCollection postCollection)&lt;br/&gt;
   at DevExpress.Web.ASPxEditors.ASPxComboBox.LoadPostData(NameValueCollection postCollection)&lt;br/&gt;
   at DevExpress.Web.ASPxClasses.ASPxWebControl.LoadPostDataInternal(NameValueCollection postCollection, Boolean raisePostDataEvent) &lt;br/&gt;&lt;br/&gt;

But still do not know where the issue is. So started again looking into code step-by-step and I have found something. The items I am adding to ASPxComboBox is the issue.&lt;br/&gt;&lt;br/&gt;

aspx &lt;br/&gt;&lt;br/&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
 &lt;dx:ASPxComboBox ID=&quot;cmbData&quot; runat=&quot;server&quot; ClientInstanceName=&quot;ClientCmbData&quot; Width=&quot;200px&quot; ClientVisible=&quot;false&quot; AutoPostBack=&quot;false&quot;&gt;
        &lt;/dx:ASPxComboBox&gt;
&lt;/pre&gt;
javascript &lt;br/&gt;&lt;br/&gt;

&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
var dataItems:
        [
          [&quot;Item1&quot;,&quot;Available&quot;],
[&quot;Item2&quot;,&quot;Available&quot;],
[&quot;Item3&quot;,&quot;Available&quot;],
[&quot;Item4&quot;,&quot;Available&quot;],
[&quot;Item5&quot;,&quot;NotAvailable&quot;],
[&quot;Item6&quot;,&quot;Available&quot;]];
var itemid = 0;
for (var i = 0; i &lt; dataItems.length; i++) {
 var dataItem = dataItems[i];
 if(dataItem[1] == &quot;Available&quot;){
   ClientCmbData.AddItem(dataItem, itemid++);
}
}
&lt;/pre&gt;
&lt;br/&gt;&lt;br/&gt;
The issue occurs at ClientCmbData.AddItem(dataItem, itemid++), instead of ClientCmbData.AddItem(dataItem[0], itemid++);&lt;br/&gt;&lt;br/&gt;

So data passed in for ASPxComboBox items text value is invalid and hence parsing fails. That&#39;s it problem solved.&lt;br/&gt;&lt;br/&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;i&gt;“The computer was born to solve problems that did not exist before.”
– Bill Gates&lt;/i&gt;

</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/6964005413489751859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/09/devexpress-input-string-was-not-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6964005413489751859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6964005413489751859'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/09/devexpress-input-string-was-not-in.html' title='DevExpress Input string was not in a correct format'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-6525531380562735216</id><published>2012-09-12T16:26:00.002-07:00</published><updated>2012-09-25T15:04:22.516-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>State management in ASP.NET for high availability of data</title><content type='html'>
ASP.NET session is the correct answer for state management. Yes that&#39;s it developers have to just use session to maintain state ie.. any data relavant to a user&#39;s session. Ways to store session state can mainly be categorized into InProc and OutProc. &lt;br /&gt;&lt;br /&gt;

&lt;h3&gt;InProc&lt;/h3&gt;&lt;br /&gt;

Session state stored as in-memory on the web server. &lt;br /&gt;&lt;br /&gt;
Websites running in &quot;Inproc&quot; mode is completely dependent on the resources of the server. Limitation for number of users is dependent on the following factors&lt;br /&gt;
- Memory of server &lt;br /&gt;
- Amount of data stored per user session&lt;br /&gt;&lt;br /&gt;

As the memory used starts to exceed available memory application pool gets recycled and hence data stored is lost.
&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;Single Web Server&lt;/h2&gt;
Easy to configure and setup. &lt;br /&gt;

To enable session state as &quot;Inproc&quot; update web.config as follows:-&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;
&lt;sessionState mode=&quot;InProc&quot; timeout=&quot;90&quot; /&gt;
&lt;/pre&gt;
&lt;br /&gt;

Advantages&lt;br /&gt;
- Easy access to data as stored in-memory
&lt;br /&gt;&lt;br /&gt;
Disadvantages&lt;br /&gt;
- Data loss due exceeded memory utilization
&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;Web Farm&lt;/h2&gt;

Another method of increasing user capacity is by enabling sticky sessions on a web farm. This can achieved by using a Network Load Balancing (NLB). NLB has a feature known as &quot;The Request Forwarder&quot; and can be used to configure a cluster (web farm). 
&lt;br /&gt;&lt;br /&gt;
Sticky sessions use a HTTP cookie, which is returned for each client request that contains server instance GUID (ie.. first server that handled the request) and session ID allocated for the user. Subsequent requests will pass back server 
instance GUID and session ID that load balancer identifies and forwards to respective server. For mode detail explanation of this works look at technet article avalaible at &lt;a 
href=&quot;http://technet.microsoft.com/en-us/library/bb734910.aspx&quot;&gt;http://technet.microsoft.com/en-us/library/bb734910.aspx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;

Advantages&lt;br /&gt;
- Increased user capacity&lt;br /&gt;
- Easy access to data as stored in-memory
&lt;br /&gt;&lt;br /&gt;

Dis-Advantages&lt;br /&gt;
- Partial load balance as user&#39;s are tied to specific server that served the request&lt;br /&gt;
- Still has possibility of data loss due exceeded memory utilization
&lt;br /&gt;&lt;br /&gt;


&lt;h3&gt;OutProc&lt;/h3&gt;&lt;br /&gt;

Session state is stored on a state server. Also this can be located on the same machine as web server or can point to another machine on your network. This mode is reliable as restarting web application does not affect state server and hence 
no data loss. &lt;br /&gt;&lt;br /&gt;

This mode can be configured either for a single server instance or for multiple servers on a web farm. In case of multiple web servers in a web farm, &lt;br /&gt;
- objects stored in session needs to be serializable&lt;br /&gt;
- should be installed on the same path in each of the web server in the Web farm.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;1)StateServer&lt;/h2&gt;

Session state is stored on an ASP.NET state service. Session data stored on a remote machine, no data loss due to application pool recycling. But still has the overhead of data loss if machine that has been configured as state management server is restarted. &lt;br /&gt;&lt;br /&gt;

Advantages&lt;br /&gt;
- No data loss due to application pool recycle

&lt;br /&gt;&lt;br /&gt;
Dis-Advantages&lt;br /&gt;
- Is still limited based on the memory&lt;br /&gt;
- Reduces performance as data is read from a remote machine
&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;2)SQLServer&lt;/h2&gt;

session state is stored in an SQL Server database. Session data stored in a database because of which data is never lost. Machine restart will still not loose data as data is stored in a database. &lt;br /&gt;&lt;br /&gt;

Advantages&lt;br /&gt;
- No data loss due to application pool recycle
- Data stored permanently in a database which has high reliability
&lt;br /&gt;&lt;br /&gt;
Dis-Advantages&lt;br /&gt;
- Reduces performance as data read is from a database
- Limited to memory allocated to database
&lt;br /&gt;&lt;br /&gt;
&lt;h2&gt;3)Custom&lt;/h2&gt;

Session state is stored on a custom provider. There are various options available for custom provider are AppFabric, Memcached etc.&lt;br /&gt;&lt;br /&gt;

&lt;b&gt;AppFabric&lt;/b&gt;&lt;br /&gt;
- distributed in-memory application cache, refer to &lt;a href=&quot;http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx&quot;&gt;AppFabric for windows server&lt;/a&gt; for more details.
&lt;br /&gt;

&lt;b&gt;Memcached&lt;/b&gt;&lt;br /&gt;
- high-performance, distributed memory object caching system, refer to &lt;a href=&quot;http://memcached.org/&quot;&gt;Memcached&lt;/a&gt; for more details.
&lt;br /&gt;

&lt;b&gt;SharedCache&lt;/b&gt;&lt;br /&gt;
- distributed and replicated memory object caching system, refer to &lt;a href=&quot;http://www.sharedcache.com/cms/&quot;&gt;SharedCache&lt;/a&gt; for more details.&lt;br /&gt;
&lt;i&gt;
“The most likely way for the world to be destroyed, most experts agree, is by accident.  That’s where we come in; we’re computer professionals.  We cause accidents.”
– Nathaniel Borenstein&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/6525531380562735216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/09/state-management-in-aspnet-for-high.html#comment-form' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6525531380562735216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/6525531380562735216'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/09/state-management-in-aspnet-for-high.html' title='State management in ASP.NET for high availability of data'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7960725789043363799.post-3556658217444658382</id><published>2012-07-16T15:49:00.001-07:00</published><updated>2012-07-20T05:50:59.752-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Controls"/><title type='text'>Various third party .NET Controls available on web</title><content type='html'>As of today there are many .NET controls developed for various technologies such as ASP.NET, Windows forms, HTML, Jquery, compression etc. Here are the list of controls available in detail.
&lt;/br&gt;&lt;/br&gt;
&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;
&lt;th&gt;Developed By&lt;/th&gt;
&lt;th&gt;Controls for&lt;/th&gt;
&lt;th&gt;Features&lt;/th&gt;
&lt;th&gt;Comments&lt;/th&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td valign=&quot;Top&quot;&gt;DevExpress&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;WinForms&lt;/li&gt;
&lt;li&gt;ASP.NET&lt;/li&gt;
&lt;li&gt;ASP.NET MVC&lt;/li&gt;
&lt;li&gt;WPF&lt;/li&gt;
&lt;li&gt;SilverLight&lt;/li&gt;
&lt;li&gt;Windows 8&lt;/li&gt;
&lt;li&gt;IOS&lt;/li&gt;
&lt;li&gt;Touch Enabled Apps&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;ul&gt;
&lt;li&gt;Reporting&lt;/li&gt;
&lt;li&gt;Charting&lt;/li&gt;
&lt;li&gt;Data Grid &amp; Rich Text Editors&lt;/li&gt;
&lt;li&gt;Ribbon, Menu, Docking&lt;/li&gt;
&lt;li&gt;Pivot Grid,Scheduler, Tree List &amp; Gauges&lt;/li&gt;
&lt;li&gt;Property Grid&lt;/li&gt;
&lt;li&gt;Layout Manager&lt;/li&gt;
&lt;li&gt;Navigation Bar&lt;/li&gt;
&lt;li&gt;Editors &amp; Controls&lt;/li&gt;
&lt;li&gt;Printing-Exporting&lt;/li&gt;
&lt;li&gt;Spell Checker&lt;/li&gt;
&lt;li&gt;Wizard Control&lt;/li&gt;
&lt;li&gt;Application Skins&lt;/li&gt;
&lt;li&gt;Themes &amp; Skins&lt;/li&gt;
&lt;li&gt;MVC Extensions&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
Advantages
&lt;ul&gt;
&lt;li&gt;Demos available for almost each and every controls &lt;/li&gt;
&lt;li&gt;Support available &lt;/li&gt;
&lt;li&gt;Source code available if purchased Universal or Enterprise&lt;/li&gt;
&lt;li&gt;Documentation provided along with examples &lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td valign=&quot;Top&quot;&gt;
Telerik
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;WinForms&lt;/li&gt;
&lt;li&gt;ASP.NET&lt;/li&gt;
&lt;li&gt;ASP.NET MVC&lt;/li&gt;
&lt;li&gt;WPF&lt;/li&gt;
&lt;li&gt;SilverLight&lt;/li&gt;
&lt;li&gt;Windows 8&lt;/li&gt;
&lt;li&gt;Windows Phone&lt;/li&gt;
&lt;li&gt;Ready for Touch&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Reporting&lt;/li&gt;
&lt;li&gt;Data Management&lt;/li&gt;
&lt;li&gt;Editors&lt;/li&gt;
&lt;li&gt;Scheduling&lt;/li&gt;
&lt;li&gt;Spell Checking&lt;/li&gt;
&lt;li&gt;Ajax&lt;/li&gt;
&lt;li&gt;Layout&lt;/li&gt;
&lt;li&gt;Navigation&lt;/li&gt;
&lt;li&gt;Visualization&lt;/li&gt;
&lt;li&gt;Upload&lt;/li&gt;
&lt;li&gt;Theming&lt;/li&gt;
&lt;li&gt;Social&lt;/li&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Interactivity&lt;/li&gt;
&lt;li&gt;Charting&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
Advantages
&lt;ul&gt;
&lt;li&gt;Demos available for almost each and every controls&lt;/li&gt;
&lt;li&gt;Support available&lt;/li&gt;
&lt;li&gt;Documentation provided along with examples&lt;/li&gt;
&lt;/ul&gt;
Disadvantages
&lt;ul&gt;
&lt;li&gt;Source code not provided&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td valign=&quot;Top&quot;&gt;
Infragistics
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;WinForms&lt;/li&gt;
&lt;li&gt;ASP.NET&lt;/li&gt;
&lt;li&gt;ASP.NET MVC&lt;/li&gt;
&lt;li&gt;WPF&lt;/li&gt;
&lt;li&gt;SilverLight&lt;/li&gt;
&lt;li&gt;Windows 8&lt;/li&gt;
&lt;li&gt;Windows Phone&lt;/li&gt;
&lt;li&gt;Sharepoint&lt;/li&gt;
&lt;li&gt;JQuery&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Editors&lt;/li&gt;
&lt;li&gt;Frameworks&lt;/li&gt;
&lt;li&gt;Office Support&lt;/li&gt; 
&lt;li&gt;Grids&lt;/li&gt;
&lt;li&gt;Interactions&lt;/li&gt;
&lt;li&gt;Layouts&lt;/li&gt;
&lt;li&gt;Lists&lt;/li&gt;
&lt;li&gt;Menus&lt;/li&gt;
&lt;li&gt;Schedules&lt;/li&gt;
&lt;li&gt;Charts&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
Advantages
&lt;ul&gt;
&lt;li&gt;Demos available for almost each and every controls&lt;/li&gt;
&lt;li&gt;Support available &lt;/li&gt;
&lt;li&gt;Documentation provided along with examples&lt;/li&gt;
&lt;li&gt;Source code available if purchased NetAdvantage Ultimate&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td valign=&quot;Top&quot;&gt;
Xceed
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;WinForms&lt;/li&gt;
&lt;li&gt;ASP.NET&lt;/li&gt;
&lt;li&gt;WPF&lt;/li&gt;
&lt;li&gt;Silverlight&lt;/li&gt;
&lt;li&gt;Compression&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Chart&lt;/li&gt;
&lt;li&gt;Grid&lt;/li&gt;
&lt;li&gt;Compression&lt;/li&gt;
&lt;li&gt;Zipping&lt;/li&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;FileTransfer&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
Advantages
&lt;ul&gt;
&lt;li&gt;Demos available for almost each and every controls &lt;/li&gt;
&lt;li&gt;Support available &lt;/li&gt;
&lt;li&gt;Documentation provided along with examples&lt;/li&gt;
&lt;li&gt;Source code available if purchased BluePrint subscription&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td valign=&quot;Top&quot;&gt;
VIBlend
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;WinForms&lt;/li&gt;
&lt;li&gt;WPF&lt;/li&gt;
&lt;li&gt;Silverlight&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Data grid&lt;/li&gt;
&lt;li&gt;Navigation bars&lt;/li&gt;
&lt;li&gt;Ribbon Interface&lt;/li&gt;
&lt;li&gt;Treeview, calendar, combo box etc&lt;/li&gt;
&lt;li&gt;Menu&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
Advantages
&lt;ul&gt;
&lt;li&gt;Demos available for almost each and every controls&lt;/li&gt;
&lt;li&gt;Support available &lt;/li&gt;
&lt;li&gt;Documentation provided along with examples&lt;/li&gt;
&lt;li&gt;Source code available if purchased with VIBlend Premium&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td valign=&quot;Top&quot;&gt;
9Rays.NET
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;WinForms&lt;/li&gt;
&lt;li&gt;WPF&lt;/li&gt;
&lt;li&gt;Silverlight&lt;/li&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;Obfuscator&lt;/li&gt;
&lt;li&gt;Decompiler&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Grid&lt;/li&gt;
&lt;li&gt;Tree view&lt;/li&gt;
&lt;li&gt;Obfuscator&lt;/li&gt;
&lt;li&gt;Decompiler&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td valign=&quot;Top&quot;&gt;
Advantages
&lt;ul&gt;
&lt;li&gt;Demos available for almost each and every controls&lt;/li&gt;
&lt;li&gt;Support available&lt;/li&gt;
&lt;li&gt;Documentation provided along with examples&lt;/li&gt;
&lt;li&gt;Source code available if purchased with Enterprise License&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharptechies.blogspot.com/feeds/3556658217444658382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://csharptechies.blogspot.com/2012/07/various-third-party-net-controls.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/3556658217444658382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7960725789043363799/posts/default/3556658217444658382'/><link rel='alternate' type='text/html' href='http://csharptechies.blogspot.com/2012/07/various-third-party-net-controls.html' title='Various third party .NET Controls available on web'/><author><name>Saif</name><uri>http://www.blogger.com/profile/03928635339145093205</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8XjroSLnhDttQHI5miSFOQl7Pd4eoWD7HhwjjB6sDZEN7vcq_d0F1zY0mDWtOw-qe20sANVkUbYPYHBYSt4dbJvcqt5OyeFcwMJSlp6i_HCnp548MNnHoEbUXNi4krg/s220/saif.jpg'/></author><thr:total>1</thr:total></entry></feed>