<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>I,Raza</title>
    <description>.Net/BizTalk/Sharepoint and some other stuff that I find interesting</description>
    <link>http://iraza.net/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.0.0</generator>
<language>en-GB</language><blogChannel:blogRoll>http://iraza.net/blog/opml.axd</blogChannel:blogRoll><dc:creator>Raza</dc:creator><dc:title>I,Raza</dc:title><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Iraza" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Cloud Computing: Skills Matter AWS Session by Cohesiveft</title><description>&lt;p&gt;Yesterday I attended a free event arranged by &lt;a href="http://skillsmatter.com/go/home"&gt;Skills Matter&lt;/a&gt;. I was not following the cloud computing revolution that much as it was not happening in Microsoft’s world at a similar level but the rest of the world was more interested in it. Nothing unusual keeping the history of MS in mind. Amazon&amp;#160; was in this business from 2002. Skills Matter arranges such free events in the London area and it was an interesting find for me. Cloud computing is defined on wikipedia as: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Cloud computing&lt;/b&gt; is &lt;a href="http://en.wikipedia.org/wiki/Internet"&gt;Internet&lt;/a&gt; (&amp;quot;cloud&amp;quot;) based development and use of computer technology. It is a style of computing in which typically real-time scalable resources are provided “as a service” over the Internet to users who need not have knowledge of, expertise in, or control over the technology infrastructure (&amp;quot;in the cloud&amp;quot;) that supports them.&lt;/p&gt;    &lt;p&gt;The concept incorporates software as a service (SaaS), Web 2.0 and other recent, well-known technology trends, in which the common theme is reliance on the Internet for satisfying the computing needs of the users.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://www.cohesiveft.com/about"&gt;Cohesiveft&lt;/a&gt;delivered this session showing off their virtual servers in the cloud model. Basically they are providing Infrastructure as service. You can think of it as a cheap hotel for applications. If you need to run your application, you can go to their site, configure your own server with your required configuration and software libraries and they will generate a server on the fly for you! Basically all this magic has come about thanks to virtualization technologies which allow you to create software servers independent of the hardware infrastructure running them. These VMs can be scaled and migrated depending on the need. &lt;/p&gt;  &lt;p&gt;Their business model is not very appealing to those companies that already own a data center, but to those who would like the processing power without the hassle of maintenance and management, along with the initial investment. This quite simply means that SMEs will approach their services. Cloud has great potential in reducing the cost, increasing utilization and efficiency and simplifying maintenance.&lt;/p&gt;  &lt;p&gt;The chief characteristics of the cloud model are:&lt;/p&gt;  &lt;blockquote&gt;   &lt;li&gt;Customers minimize &lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Capital_expenditure"&gt;capital expenditure&lt;/a&gt;&lt;/b&gt;; this lowers &lt;a href="http://en.wikipedia.org/wiki/Barriers_to_entry"&gt;barriers to entry&lt;/a&gt;, as infrastructure is owned by the provider and does not need to be purchased for one-time or infrequent intensive computing tasks. Services are typically available to or specifically targeted to retail consumers and small businesses. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Device_independence"&gt;Device&lt;/a&gt; and location independence&lt;/b&gt; enable users to access systems regardless of their location or what device they are using, e.g., PC, mobile. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Multitenancy"&gt;Multi-tenancy&lt;/a&gt;&lt;/b&gt; enables sharing of resources and costs among a large pool of users, allowing for:       &lt;ul&gt;       &lt;li&gt;&lt;b&gt;Centralization&lt;/b&gt; of infrastructure in areas with lower costs (such as real estate, electricity, etc.) &lt;/li&gt;        &lt;li&gt;&lt;b&gt;Peak-load capacity&lt;/b&gt; increases (users need not engineer for highest possible load-levels) &lt;/li&gt;        &lt;li&gt;&lt;b&gt;Utilisation and efficiency&lt;/b&gt; improvements for systems that are often only 10-20% utilised. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Utility_computing"&gt;On-demand allocation&lt;/a&gt;&lt;/b&gt; and de-allocation of CPU, storage and network bandwidth &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Computer_performance"&gt;Performance&lt;/a&gt;&lt;/b&gt; is monitored and consistent, but can suffer from insufficient bandwidth or high network load. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Reliability"&gt;Reliability&lt;/a&gt;&lt;/b&gt; improves through the use of multiple redundant sites, which makes it suitable for business continuity and disaster recovery. Nonetheless, most major cloud computing services have suffered outages and IT and business managers are able to do little when they are affected. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Scalability"&gt;Scalability&lt;/a&gt;&lt;/b&gt; meets changing user demands quickly without users having to engineer for peak loads. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Computer_security"&gt;Security&lt;/a&gt;&lt;/b&gt; typically improves due to centralization of data, increased security-focused resources, etc., but raises concerns about loss of control over certain sensitive data. Security is often as good as or better than traditional systems, in part because providers are able to devote shared resources that most customers cannot afford. Providers typically log accesses, but accessing the &lt;a href="http://en.wikipedia.org/wiki/Audit_log"&gt;audit logs&lt;/a&gt; themselves can be difficult or impossible. &lt;/li&gt;    &lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Sustainability"&gt;Sustainability&lt;/a&gt;&lt;/b&gt; comes about through improved resource utilization, more efficient systems, and carbon neutrality. Nonetheless, computers and associated infrastructure are major consumers of energy. &lt;/li&gt; &lt;/blockquote&gt;  &lt;p&gt;From the characteristics, a few things jump out that point us towards the problems and concerns that are preventing clouds widespread adoption.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Control&lt;/strong&gt;: When you give up the management of your infrastructure, you also give up control over it. This reduces your burden but also makes you anxious and vulnerable. Now you have to rely on the guarantees provided by the cloud vendor.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;: This is the biggest concern as data is the most critical asset of a company. They don’t want to put it in any one else’s hand. Great assurances are required here by the service providers, otherwise they aren’t likely to succeed. Not every provider can afford that unless the industry finds a way to simplify this for them.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Dependability:&lt;/strong&gt; Today a service provider exists, tomorrow they don’t. Companies cannot rely on such services. They need continuity.&lt;/p&gt;  &lt;p&gt;Still I believe cloud has great potential and it is possibly the only next method of application development and delivery to be. Hence anyone out there who is interested in development applications for the future should keenly follow this trend as it holds great returns.&lt;/p&gt;</description><link>http://iraza.net/blog/post/Cloud-Computing-Skills-Matter-AWS-Session-by-Cohesiveft.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Cloud-Computing-Skills-Matter-AWS-Session-by-Cohesiveft.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=ef195091-42b6-49f3-9f6b-70a7d1c5a1c0</guid><pubDate>Sat, 07 Feb 2009 21:01:32 +0500</pubDate><category>Architecture</category><category>Community</category><category>Sessions</category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=ef195091-42b6-49f3-9f6b-70a7d1c5a1c0</pingback:target><slash:comments>93</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=ef195091-42b6-49f3-9f6b-70a7d1c5a1c0</trackback:ping><wfw:comment>http://iraza.net/blog/post/Cloud-Computing-Skills-Matter-AWS-Session-by-Cohesiveft.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=ef195091-42b6-49f3-9f6b-70a7d1c5a1c0</wfw:commentRss></item><item><title>Important lesson</title><description>&lt;img src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/Importantlesson_A781/image_b7ad13aa-e9f1-47a3-b4fb-36787a144acf.png" alt="image" width="560" height="174" /&gt;
</description><link>http://iraza.net/blog/post/Important-lesson.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Important-lesson.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=9a0e9a50-1c7f-43d9-bc15-8412de16d431</guid><pubDate>Sun, 18 Jan 2009 16:54:00 +0500</pubDate><category>General </category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=9a0e9a50-1c7f-43d9-bc15-8412de16d431</pingback:target><slash:comments>7</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=9a0e9a50-1c7f-43d9-bc15-8412de16d431</trackback:ping><wfw:comment>http://iraza.net/blog/post/Important-lesson.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=9a0e9a50-1c7f-43d9-bc15-8412de16d431</wfw:commentRss></item><item><title>A new logo for .net?</title><description>&lt;p&gt;&lt;img height="253" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/Anewlogofor.net_14224/image_57e112fe-40a9-41cb-aebc-c14dfefecf47.png" width="520"&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/msmossyblog/archive/2008/10/25/embrace-the-new-net-logo.aspx" target="_blank"&gt;read more...&lt;/a&gt;&lt;/p&gt;</description><link>http://iraza.net/blog/post/A-new-logo-for-net.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/A-new-logo-for-net.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=b1624dc9-8e7e-418c-a91a-7f2800a9505f</guid><pubDate>Mon, 27 Oct 2008 23:54:36 +0500</pubDate><category>.Net</category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=b1624dc9-8e7e-418c-a91a-7f2800a9505f</pingback:target><slash:comments>5</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=b1624dc9-8e7e-418c-a91a-7f2800a9505f</trackback:ping><wfw:comment>http://iraza.net/blog/post/A-new-logo-for-net.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=b1624dc9-8e7e-418c-a91a-7f2800a9505f</wfw:commentRss></item><item><title>Eid Mubarak To All Muslims!</title><description>&lt;p&gt;Have a happy and joyous Eid and don't be shy to celebrate it as it the celebration of your patience and commitment to God's word during the whole month of Ramadan. Even if your fasts left something to be desired, at least you kept your fasts and made it all the way. Be happy about it and share the joy.&lt;/p&gt; &lt;p&gt;&lt;img style="margin: 10px" height="450" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/EidMubarakToAllMuslims_171B/image_492483e7-b1e6-48d6-9fdc-8e707afe8884.png" width="333"&gt;&lt;/p&gt;</description><link>http://iraza.net/blog/post/Eid-Mubarak-To-All-Muslims!.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Eid-Mubarak-To-All-Muslims!.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=21206a4f-4e88-4396-a949-5ee53781f973</guid><pubDate>Tue, 30 Sep 2008 02:39:53 +0500</pubDate><category>General </category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=21206a4f-4e88-4396-a949-5ee53781f973</pingback:target><slash:comments>1</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=21206a4f-4e88-4396-a949-5ee53781f973</trackback:ping><wfw:comment>http://iraza.net/blog/post/Eid-Mubarak-To-All-Muslims!.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=21206a4f-4e88-4396-a949-5ee53781f973</wfw:commentRss></item><item><title>Saving/Retrieving images from SQL Server for ASP.Net Website</title><description>&lt;p&gt;For one of the projects I am working on these days, I had to provide image hosting from the database meaning the images will be stored in the the database when the user uploads them to my site and is fetched from the database on request. After looking around for hardly 15mins the solution was there. SQL Server's image type came to the rescue but I read in some article that MS was going to discontinue this type and only keep the varbinary for such purposes. While its available in SQL Server 2005, why not take advantage of it.&lt;/p&gt; &lt;p&gt;Let's say we have the following table structure which represents the different sites of an organization. Each site has its own logo and needs to be displayed on different pages of our site.&lt;/p&gt; &lt;p&gt;&lt;img height="133" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_b8840f98-bf9c-416e-9f49-83c6bfd2de02.png" width="344"&gt; &lt;/p&gt; &lt;p&gt;Let's first look at how to save the image in the database when it is uploaded from one of the pages in the website (in case its desktop application there is one less step here).&lt;/p&gt; &lt;p&gt;&lt;img height="125" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_55450d11-1e9f-4393-ae22-45c3cbe66ef8.png" width="316"&gt; &lt;/p&gt; &lt;p&gt;If this were a desktop application I would have probably written:&lt;/p&gt; &lt;p&gt;&lt;img height="126" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_4480e358-439b-4384-a6ce-c428077f8381.png" width="534"&gt; &lt;/p&gt; &lt;p&gt;Let me explain the code here a little. The fuLogoImage is a FileUpload control and the code is simply checking if a file was uploaded through the control when the pages was submitted, using its HasFile property. If it was, then simply get the file as a byte[] and use ADO.Net to write this array to a Image column in the database. In my case here I have used a Typed Dataset, hence the "ta" before the Sites representing the TableAdapter for the Sites table. Notice I simply passed the byte[] without any additional work. You can also simply write a Insert command with the byte[] placed at the right column and ADO.Net will take care of the streaming to database.&lt;/p&gt; &lt;p&gt;Once the file is stored in the database in the LogoImage column, we can then start writing code to display it in our pages. Since the images are being generated dynamically for a given ID, we need a method to bypass the static URL requirement of the image tag. Luckily, there is such a trick and it is called a HTTP Handler. Everything you service in a web server is handled through an HTTP handler, including your aspx pages. If you go to IIS Manager and open the properties of any application, then open the configuration tab, you will see a window like this:&lt;/p&gt; &lt;p&gt;&lt;img height="253" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_7612b2a1-5d33-4653-8a75-1887914ca851.png" width="405"&gt; &lt;/p&gt; &lt;p&gt;which shows the handler for each type of file the web server (IIS) will be dealing with. Basically, IIS itself does not know how to deal with a file so it passes on the handing responsibility to one of these programs depending on the extension. If I double click the aspx handler description, I see:&lt;/p&gt; &lt;p&gt;&lt;img height="239" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_8d53a3af-14db-4c0e-8fc9-c9a19bf22de1.png" width="430"&gt; &lt;/p&gt; &lt;p&gt;So, all http commands for the aspx file are being handled by the asp_isapi.dll extension. This extension is responsible for all the aspx page interpretation, session handling and other features that you like so much. Coming back to our topic, we need to write a handler just like that to generate images dynamically. For that we will use the ASP.Net generic http handler. If you go to your project and add new item, you will see:&lt;/p&gt; &lt;p&gt;&lt;img height="280" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_48d4553e-3e0b-4fa8-b7a4-2edbd6803335.png" width="472"&gt;&lt;/p&gt; &lt;p&gt;Adding this will give you something like this:&lt;/p&gt; &lt;p&gt;&lt;img height="353" alt="image" src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/SavingandretrievingimagesfromSQLServer_131C/image_c54c9cdd-c9ff-4b60-bcec-a55b78a30ed3.png" width="548"&gt; &lt;/p&gt; &lt;p&gt;The handler implements the IHttpHandler interface which has the capability to handle all the Http commands like Get and Post etc. I you would like session handing capabilities then you can also implement the IRequiresSessionState or IReadOnlySessionState interface. Now, the IHttpHandler contains a function called ProcessRequest where we need to implement our custom logic. I am passing the image ID as a query string parameter to the handler and the code looks like the following:&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ProcessRequest (HttpContext context) 
    {
        &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] image;
        
        context.Response.ContentType = &lt;span style="color: #006080"&gt;"image/jpeg"&lt;/span&gt;;

        &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt; siteid = &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;.Parse(context.Request.QueryString[&lt;span style="color: #006080"&gt;"SiteID"&lt;/span&gt;]);

        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (siteid == -1)
            image = GetNoLogo(context);
        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
        {
            ECFormsTableAdapters.Lkp_SitesTableAdapter taSites = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ECFormsTableAdapters.Lkp_SitesTableAdapter();
            ECForms.Lkp_SitesDataTable dtSites = taSites.GetDataBySiteID(siteid);

            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (dtSites.Count == 0 || dtSites[0].LogoImage == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
                image = GetNoLogo(context);
            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
                image = dtSites[0].LogoImage;
        }
        context.Response.BinaryWrite(image);
    }&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here I fetch the image from the database and then simply write it to the response stream using the proper content type description. In my example I have placed the limit that the image has to be a jpg, as visible from the content type header. The GetNoLogo function basically replaces the image with a default logo that is stored in the file system. The code looks something like this:&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] GetNoLogo(HttpContext context)
    {
        &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] imageNoLogo;
        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; nologopath = context.Server.MapPath(&lt;span style="color: #006080"&gt;"images/nologo.jpg"&lt;/span&gt;);
        
        &lt;span style="color: #0000ff"&gt;lock&lt;/span&gt; (lockObject)
        {
            FileStream fs = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; FileStream(nologopath, FileMode.Open,FileAccess.Read);
            imageNoLogo = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[fs.Length];
            fs.Read(imageNoLogo, 0, (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)fs.Length);
            fs.Close();
        }        
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; imageNoLogo;
    }&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;I have put a lock around the file access to prevent multiple threads from simultaneously opening the file. I should use some caching strategy here but for the moment it is good enough. Now to use it in the asp.net code I define a image tag anywhere in the html&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;asp:Image ID=&lt;span style="color: #006080"&gt;"ImgLogo"&lt;/span&gt; runat=&lt;span style="color: #006080"&gt;"server"&lt;/span&gt; Height=&lt;span style="color: #006080"&gt;"52px"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt; and make the src look like this through the code in Page_Load:&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;ImgLogo.ImageUrl = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;"ImageHandler.ashx?SiteID={0}"&lt;/span&gt;, SelectedSite);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;and that's it! When the browser renders this image it calls the associated url for image and at the web server this url is a handler that dynamically renders the image using the parameter. Create a site with dynamic images from the database now. Obvious advantages include:&lt;/p&gt;
&lt;p&gt;- Single storage of all files.&lt;/p&gt;
&lt;p&gt;- Centralized management&lt;/p&gt;
&lt;p&gt;- Database searching and meta data storage facility for the images&lt;/p&gt;
&lt;p&gt;- Centralized backup and recovery&lt;/p&gt;
&lt;p&gt;Some disadvantages include:&lt;/p&gt;
&lt;p&gt;- Performance hit&lt;/p&gt;
&lt;p&gt;- Single point of failure&lt;/p&gt;
&lt;p&gt;But then, the choice is yours. Depending on the situation you have to pick one over another. &lt;/p&gt;</description><link>http://iraza.net/blog/post/SavingRetrieving-images-from-SQL-Server-for-ASPNet-Website.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/SavingRetrieving-images-from-SQL-Server-for-ASPNet-Website.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=9b2f5006-6b3f-43af-ab35-4d83a6af7135</guid><pubDate>Tue, 05 Aug 2008 22:52:46 +0500</pubDate><category>ASP.Net</category><category>SQL Server</category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=9b2f5006-6b3f-43af-ab35-4d83a6af7135</pingback:target><slash:comments>7</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=9b2f5006-6b3f-43af-ab35-4d83a6af7135</trackback:ping><wfw:comment>http://iraza.net/blog/post/SavingRetrieving-images-from-SQL-Server-for-ASPNet-Website.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=9b2f5006-6b3f-43af-ab35-4d83a6af7135</wfw:commentRss></item><item><title>Upgrading to BlogEngine.Net 1.4</title><description>&lt;p&gt;This weekend I spent sometime upgrading my site to 1.4 version of BlogEngine.Net from 1.3. Following &lt;a href="http://nyveldt.com/blog/post/BlogEngineNET-14-Upgrade-Guide.aspx" target="_blank"&gt;this&lt;/a&gt; post from Al Nyveldt, I upgraded the site first on my laptop and tested for proper working then uploaded to the server. But it was not all hunky dory. Major changes have been made which needed to be adapted to, for example, the new themes support the widget model and all my customizations to previous theme had to be redone to take advantage of the new model. It is not to say that the previous theme was not working, it was, but it was static ofcourse as opposed to the new version. Also one control that I had added to it could not put into the new version because its simply a web control and not made to fit the widget model. I might have to do and upgrade on that as well during the week. Another thing that is giving me unnecessary trouble is that editor for the profile widget. It for some reason always points to the /admin folder and does not allow me to refer images from other folders. To bypass that I had to use the relative path ".." trick to move one level up and point the image to some other location.&lt;/p&gt; &lt;p&gt;One thing that has disappointed me is that there is still the lack of good reporting in the engine. I have used Wordpress before and coming from there I consider this a major shortcoming. There is no reporting on the post visits and because of that no controls for popular posts or regular commenter etc. I hope these features are coming soon. But then, this is also an opportunity for those who need it to build these controls for the community.&lt;/p&gt;</description><link>http://iraza.net/blog/post/Upgrading-to-BlogEngineNet-14.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Upgrading-to-BlogEngineNet-14.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=196d8d68-eb90-40fe-8b6d-7a33b04b881a</guid><pubDate>Sun, 27 Jul 2008 13:04:52 +0500</pubDate><category>BlogEngine.Net</category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=196d8d68-eb90-40fe-8b6d-7a33b04b881a</pingback:target><slash:comments>15</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=196d8d68-eb90-40fe-8b6d-7a33b04b881a</trackback:ping><wfw:comment>http://iraza.net/blog/post/Upgrading-to-BlogEngineNet-14.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=196d8d68-eb90-40fe-8b6d-7a33b04b881a</wfw:commentRss></item><item><title>C# 4.0, what's to come?</title><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;I came across this interesting video called "meet the design team" for C# 4.0. After the successful launch of C# 3.0 the design team is already on its way to build the next generation of the language and set the agenda for what is required of it. From the discussion the salient points I can gather are:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Power of dynamic&lt;/strong&gt;: You know the thing about languages like javascript and VB that you don't have to define everything before hand, like in statically typed languages like C# and its predecessors and you program and define as you go along. Well, the that is the power of dynamic languages. They don't enforce a whole lot of structure on you when writing your programs because they don't care about the program being perfectly typed and thoroughly structured, rather their focus is on the program flow so that you can achieve what you plan to do in the least amount of time. Simple.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Power of functional&lt;/strong&gt;: If you have worked with any "declarative" language and chances are that you have, then you would know what power functional languages give you. Every developer these days has worked with SQL which is a declarative language and and C# programmers have been exposed to the new LINQ model which is also pretty declarative. The thing about declarative is that instead of writing the program as a series of steps, like a flowchart, where you convert your intent into a well defined structure, you just go ahead and express your intent and say be and it is. Like for example when writing and SQL statement you don't specify "how" it will execute and use indexes and generate temporary tables or loop through a table for every matching row, you just say it should do all that and it does. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Power of concurrency&lt;/strong&gt;: A point that Anders makes towards the end of the session referring to the Moore's Law, which states that computing power will double every eighteen months, is that the increase of power has taken a shift from more megahertz to more processors because we have kind of reached a limit for how small and fast can we make a processor. So, we are just putting in more of them to meet the demand. Now to effectively adapt to this new trend the languages must have some constructs that allow the programmer to express his "intent" regarding concurrency. &lt;/p&gt; &lt;p&gt;Watch and enjoy.&lt;/p&gt; &lt;p&gt;&lt;iframe src="http://channel9.msdn.com/posts/Charles/409364/player/" frameborder="0" width="320" scrolling="no" height="325"&gt;&lt;/iframe&gt;&lt;br&gt;&lt;a href="http://channel9.msdn.com/posts/Charles/C-40-Meet-the-Design-Team/"&gt;C# 4.0: Meet the Design Team&lt;/a&gt;&lt;/p&gt;</description><link>http://iraza.net/blog/post/C-402c-whats-to-come.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/C-402c-whats-to-come.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=1323423f-cc40-43e5-b573-ca89e7439216</guid><pubDate>Sat, 26 Jul 2008 13:06:56 +0500</pubDate><category>.Net</category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=1323423f-cc40-43e5-b573-ca89e7439216</pingback:target><slash:comments>25</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=1323423f-cc40-43e5-b573-ca89e7439216</trackback:ping><wfw:comment>http://iraza.net/blog/post/C-402c-whats-to-come.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=1323423f-cc40-43e5-b573-ca89e7439216</wfw:commentRss></item><item><title>Upcoming topics</title><description>&lt;p&gt;I have received a request to write a tutorial on WCF, which coincidently was going to be one of things I planned to write about. These days I am looking through a number of other topics including workflows in Sharepoint, VSTO, OBAs, ASP.Net AJAX, MVC, Silverlight, EntityFramework etc. I wish to write about a lot of these things but for some reason cannot find the time to do it. When you really need the time, it starts running away from you so quickly that it is very hard to keep up with it. But I will definitely try to run the WCF series as well, along with other topics interleaving. I am hoping to maintain a two post per week momentum, lets see how much success do I get trying this. &lt;/p&gt;</description><link>http://iraza.net/blog/post/Upcoming-topics.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Upcoming-topics.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=b954fdf8-3dd7-4cce-836f-56432496a191</guid><pubDate>Tue, 22 Jul 2008 10:31:29 +0500</pubDate><category>General </category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=b954fdf8-3dd7-4cce-836f-56432496a191</pingback:target><slash:comments>1</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=b954fdf8-3dd7-4cce-836f-56432496a191</trackback:ping><wfw:comment>http://iraza.net/blog/post/Upcoming-topics.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=b954fdf8-3dd7-4cce-836f-56432496a191</wfw:commentRss></item><item><title>Using AD membership provider in ASP.Net</title><description>&lt;p&gt;Recently I needed to provide authentication from the Active Directory for a custom ASP.Net form. I was pleasantly surprised to find that there is a ready-made authentication provider available for active directory, similar to the database one.&lt;/p&gt; &lt;p&gt;Despite the provider the second problem was that I had to put the authentication inside a custom form where I could not use the Login controls that are integrated with the membership providers for ASP.Net. Then with little investigation I found out that it was very simple to do that as well and all the functionality of the provider could be accessed from outside the controls. I became a fan of ASP.Net once again.&lt;/p&gt; &lt;p&gt;The steps to use it in the custom form are very simple. Since this is forms authentication, you put in the relevant entry in web.config.&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;authentication mode=&lt;span style="color: #006080"&gt;"Forms"&lt;/span&gt;&amp;gt;
  &amp;lt;forms
      name=&lt;span style="color: #006080"&gt;".ADAuthCookie"&lt;/span&gt;       
      timeout=&lt;span style="color: #006080"&gt;"10"&lt;/span&gt; /&amp;gt;
&amp;lt;/authentication&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This put ASP.Net in forms authentication mode, hence next step is to define the details of which forms will be used for this purpose.&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;forms name=&lt;span style="color: #006080"&gt;".ASPXAUTH"&lt;/span&gt; loginUrl=&lt;span style="color: #006080"&gt;"login.aspx"&lt;/span&gt; 
       defaultUrl=&lt;span style="color: #006080"&gt;"default.aspx"&lt;/span&gt; protection=&lt;span style="color: #006080"&gt;"All"&lt;/span&gt; timeout=&lt;span style="color: #006080"&gt;"30"&lt;/span&gt; path=&lt;span style="color: #006080"&gt;"/"&lt;/span&gt; 
       requireSSL=&lt;span style="color: #006080"&gt;"false"&lt;/span&gt; slidingExpiration=&lt;span style="color: #006080"&gt;"true"&lt;/span&gt;
       cookieless=&lt;span style="color: #006080"&gt;"UseDeviceProfile"&lt;/span&gt; domain=&lt;span style="color: #006080"&gt;""&lt;/span&gt; 
       enableCrossAppRedirects=&lt;span style="color: #006080"&gt;"false"&lt;/span&gt;&amp;gt;
  &amp;lt;credentials passwordFormat=&lt;span style="color: #006080"&gt;"SHA1"&lt;/span&gt; /&amp;gt;
&amp;lt;/forms&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The above tag specifies the default.aspx page as the url it gets redirected to once the user is authenticated. The authentication is actually done on the login.aspx page. The rest of the parameters define what will be the behavior of the authentication mode, for example, that there will be a 30min timeout with sliding window, it will not use SSL and cookie creation will depend on the client device.&lt;/p&gt;
&lt;p&gt;The next step is to secure all the files so that only a select few are available without authentication and the rest can be accessed only after the user has successfully logged in. The few available anonymously contains the login page.&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;authorization&amp;gt; 
  &amp;lt;deny users=&lt;span style="color: #006080"&gt;"?"&lt;/span&gt; /&amp;gt;
  &amp;lt;allow users=&lt;span style="color: #006080"&gt;"*"&lt;/span&gt; /&amp;gt;
&amp;lt;/authorization&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The above tags say that all anonymous accesses should be denied and all authenticated access allowed. The reason for saying both of them is that you can choose what to deny and what to allow. For example you can deny all then allow a selected number of files and directories. This kind of rule logic is common in firewall configurations.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Since we are authenticating through AD, we need to define it as a data source. This data source will first of all have a connection string.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;p&gt;&amp;lt;connectionStrings&amp;gt;
  &amp;lt;add name=&lt;span style="color: #006080"&gt;"ADConnectionString"&lt;/span&gt; connectionString=&lt;span style="color: #006080"&gt;"LDAP://testdomain.test.com/DC=testdomain,DC=test,DC=com"&lt;/span&gt; /&amp;gt;
 &amp;lt;/connectionStrings&amp;gt;
&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The only thing that needs explanation here is the connectionstring parameter. It is defining that AD will be accessed through LDAP protocol and what follows the // is the server name holding AD, you don't necessarily need to specify the actual server name if the domain name resolves to it. The DC part specifies the domain name. So if its contoso.com then it will be DC=contoso, DC=com. The reason I understand for this is that AD is a hierarchical database and hence we are defining this part of the connection string in a tree fashion. After the connection string we need to define the actual membership provider that will service all authentication queries.&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;p&gt;&amp;lt;membership defaultProvider=&lt;span style="color: #006080"&gt;"MyADMembershipProvider"&lt;/span&gt;&amp;gt;
  &amp;lt;providers&amp;gt;
    &amp;lt;add
       name=&lt;span style="color: #006080"&gt;"MyADMembershipProvider"&lt;/span&gt;
       type=&lt;span style="color: #006080"&gt;"System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
             Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;/span&gt;
       connectionStringName=&lt;span style="color: #006080"&gt;"ADConnectionString"&lt;/span&gt;
       connectionUsername=&lt;span style="color: #006080"&gt;"testdomain\administrator"&lt;/span&gt; 
       connectionPassword=&lt;span style="color: #006080"&gt;"password" &lt;/span&gt;attributeMapUsername="sAMAccountName" /&amp;gt;
  &amp;lt;/providers&amp;gt;
 &amp;lt;/membership&amp;gt;
&lt;/p&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It references the assembly required and provide a username/password that will be used to query the active directory server. This user should have enough rights to read the active directory. The last attribute attributeMapUsername is set to "sAMAccountName" which means the user will provide username in the format domain\username. While if this was not set then the default format is &lt;a href="mailto:username@domain"&gt;username@domain&lt;/a&gt;.&amp;nbsp; This is all there is to it for the setup. Now lets use it in the code.&lt;/p&gt;
&lt;p&gt;The first thing I intend to do is to validate a user from active directory using the submitted username and password. Once the user is authenticated we would typically like to redirect user to the first page, which in our case is defined as the default page in forms configuration. &lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Membership.ValidateUser(username, password))
{
&lt;span style="color: #008000"&gt;//valid user do your thing here&lt;/span&gt;
FormsAuthentication.RedirectFromLoginPage(username, &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;);
}
&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
{
&lt;span style="color: #008000"&gt;//failed, give some message&lt;/span&gt;
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After authentication from the membership provider we can use the FormsAuthentication class to send the user to the default page. The second parameter which is 'false' in our case relates to the 'Remember Me' in the login box, which allows you to put a persistent cookie.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/ms998360.aspx" target="_blank"&gt;following&lt;/a&gt;MSDN article gives you some recommendations on making your website more secure:&lt;/p&gt;
&lt;blockquote&gt;
&lt;h4&gt;Security Considerations&lt;/h4&gt;
&lt;p&gt;Failing to protect authentication tickets is a common vulnerability that can lead to unauthorized spoofing and impersonation, session hijacking, and elevation of privilege. When you use forms authentication, consider the following recommendations to help ensure a secure authentication approach: 
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Restrict the authentication cookie to HTTPS connections.&lt;/b&gt; To prevent forms authentication cookies from being captured and tampered with while crossing the network, ensure that you use Secure Sockets Layer (SSL) with all pages that require authenticated access and restrict forms authentication tickets to SSL channels. 
&lt;li&gt;&lt;b&gt;Partition the site for SSL.&lt;/b&gt; This allows you to avoid using SSL for the entire site.&lt;b&gt; &lt;/b&gt;
&lt;li&gt;&lt;b&gt;Do not persist forms authentication cookies. &lt;/b&gt;Do not persist authentication cookies because they are stored in the user's profile on the client computer and can be stolen if an attacker gets physical access to the user's computer. 
&lt;li&gt;&lt;b&gt;Consider reducing ticket lifetime.&lt;/b&gt; Consider reducing the cookie lifetime to reduce the time window in which an attacker can use a captured cookie to gain access to your application with a spoofed identity. 
&lt;li&gt;&lt;b&gt;Consider using a fixed expiration.&lt;/b&gt; In scenarios where you cannot use SSL, consider setting &lt;b&gt;slidingExpiration="false"&lt;/b&gt;. 
&lt;li&gt;&lt;b&gt;Enforce strong user management policies.&lt;/b&gt; Use and enforce strong passwords for all user accounts to ensure that people cannot guess one another's passwords and to mitigate the risk posed by dictionary attacks. 
&lt;li&gt;&lt;b&gt;Enforce password complexity rules.&lt;/b&gt; Validate passwords entered through the &lt;b&gt;CreateUserWizard&lt;/b&gt; control, by setting its &lt;b&gt;PasswordRegularExpression&lt;/b&gt; property to an appropriate regular expression. Also configure the membership provider on the server to use the same regular expression.&lt;b&gt; &lt;/b&gt;
&lt;li&gt;&lt;b&gt;Perform effective data validation on all requests. &lt;/b&gt;Perform strict data validation to minimize the possibilities of SQL injection and cross-site scripting. 
&lt;li&gt;&lt;b&gt;Use distinct cookie names and paths.&lt;/b&gt; By ensuring unique cookie names and paths, you prevent possible problems that can occur when hosting multiple applications on the same server. 
&lt;li&gt;&lt;b&gt;Keep authentication and personalization cookies separate.&lt;/b&gt; Keep personalization cookies that contain user-specific preferences and non-sensitive data separate from authentication cookies. 
&lt;li&gt;&lt;b&gt;Use absolute URLs for navigation.&lt;/b&gt; This is to avoid potential issues caused by redirecting from HTTP to HTTPS pages. &lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;
&lt;p&gt;Once you are done with the authentication there are a number of features that you might want to explore. For example, one thing I needed was the ability to query the AD for verifying usernames when they are put in one of the admin screens. For that you need to put the line &lt;strong&gt;enableSearchMethods ="true"&lt;/strong&gt; in your membership provider and you will have access to search functions.&lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;MembershipUserCollection users = Membership.FindUsersByName(username);
&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; email = users[username].Email;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The search function returns you a collection of users matching the criteria and once you get this collection you can get individual users properties set in the AD. For example in this case I needed the email of the user to send an information email regarding the executed process.
&lt;p&gt;I am pasting links to two MSDN articles which will allow you to explore this further. At the end of the first article you will find a table of all the properties you can set in you membership provider which will allow you to use almost all services provided by the AD.
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms998360.aspx" target="_blank"&gt;How To: Use Forms Authentication with Active Directory in ASP.NET 2.0&lt;/a&gt;
&lt;p&gt;The second article discusses specifically the security considerations of using this membership provider and this might of use when you are looking to tune the security of your site for a specific environment.
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms998310.aspx" target="_blank"&gt;How To: Protect Forms Authentication in ASP.NET 2.0&lt;/a&gt;&lt;/p&gt;</description><link>http://iraza.net/blog/post/Using-AD-membership-provider-in-ASPNet.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Using-AD-membership-provider-in-ASPNet.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=2744935e-1549-4273-843b-3235c419147e</guid><pubDate>Mon, 21 Jul 2008 11:31:44 +0500</pubDate><category>ASP.Net</category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=2744935e-1549-4273-843b-3235c419147e</pingback:target><slash:comments>3</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=2744935e-1549-4273-843b-3235c419147e</trackback:ping><wfw:comment>http://iraza.net/blog/post/Using-AD-membership-provider-in-ASPNet.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=2744935e-1549-4273-843b-3235c419147e</wfw:commentRss></item><item><title>Wally is my Guru</title><description>&lt;p&gt;
&lt;img src="http://iraza.net/blog/image.axd?picture=WindowsLiveWriter/WallyismyGuru_11906/image_77555b78-d629-422e-94c8-2ec4179221b3.png" alt="image" width="611" height="273" /&gt;
&lt;/p&gt;
</description><link>http://iraza.net/blog/post/Wally-is-my-Guru.aspx</link><author>mail.nospam@nospam.iraza.net (raza)</author><comments>http://iraza.net/blog/post/Wally-is-my-Guru.aspx#comment</comments><guid>http://iraza.net/blog/post.aspx?id=20495f2b-a6b8-4bdc-9719-04279de236c3</guid><pubDate>Sun, 13 Jul 2008 21:02:00 +0500</pubDate><category>General </category><dc:publisher>raza</dc:publisher><pingback:server>http://iraza.net/blog/pingback.axd</pingback:server><pingback:target>http://iraza.net/blog/post.aspx?id=20495f2b-a6b8-4bdc-9719-04279de236c3</pingback:target><slash:comments>10</slash:comments><trackback:ping>http://iraza.net/blog/trackback.axd?id=20495f2b-a6b8-4bdc-9719-04279de236c3</trackback:ping><wfw:comment>http://iraza.net/blog/post/Wally-is-my-Guru.aspx#comment</wfw:comment><wfw:commentRss>http://iraza.net/blog/syndication.axd?post=20495f2b-a6b8-4bdc-9719-04279de236c3</wfw:commentRss></item></channel>
</rss>
