ScioSoft's Community Blogs Optimized IT musings for the technically inclined

Feed Control: Redirect RSS feeds to FeedBurner and AdSense using CNAME

by James Fielding 25. March 2010 11:02

If you are anything like me, then you spend a significant amount of your professional life thinking about "what ifs". What if a system's user does this? What if a hacker does that? What if the good people at Google mistakenly sell FeedBurner to some evil people, who in-turn take my redirected RSS (or ATOM) blog or news feed hostage?

Whether your using Wordpress, BlogEngine.NET, or another syndication CMS, many administrators look at moving their feeds to FeedBurner to monetize their feed using AdSense, or to gain access to some great syndication and analysis tools.  Some of these people happily redirect their subscribers directly to FeedBurner's feeds at http://feeds.feedburner.com, without a second thought. 

BE FOREWARNED: If at some point you are unhappy, and decide to leave, you can't simply redirect your feed elsewhere, again. This would be known as "committing blogicide", as you won't be taking your old subscribers with you; you're just redirecting the new subscribers. This is obviously less than ideal.

As it stands today: Don't worry, you may be OK. If you decide to leave FeedBurner, as of this post's publish date, the good people at Google have provided tools to transfer your feed elsewhere. Having said this, if you've linked directly, you'll be relying on their system to exist in the future to do the transfer. Everything else being equal, I'd prefer to have control, rather than give it away and rely on someone else. After all, it's my feed. I should own it.

Here's how you keep control of your feed:

  1. Determine if your hosting provider will allow you to create a CNAME entry in your site's DNS records. This may sound complicated, but it's not. If you're using a shared hosting account, you may be able to do this through your control panel, or you may have to email your helpdesk to do it for you. Check you provider's knowledge base, or email their helpdesk directly to get a straight answer.
  2. You'll also need to be able to add subdomains to your site. It is common to name your feed subdomain something like "feeds.mysite.com" or "rss.mysite.com". You don't need to add the subdomain, yet. We'll do this in step 5. But, if you are in doubt about if/how to do this, check it out with your helpdesk, too.
  3. If step 1 & 2 are doable, log into your Google's FeedBurner account. If you haven't already set up a FeedBurner feed for each of your existing feeds, do so now. Just so there is no confusion, I'm going to rephrase what we're doing here: In this step we're telling FeedBurner where you currently publish your xml feed files on your site.
  4. While still logged into FeedBurner,  go to My Account > Services > MyBrand. Here you'll find the critical CNAME entry snippet. It will look something like:

    feeds CNAME xxxxxx.feedproxy.ghs.google.com

    where "xxxxxx" will be replaced by your FeedBurner account's unique ID. More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , , , , , , , , , ,

Server | Syndication | Web Development

Build an AJAX Contact Us Form using network callbacks in ASP.NET

by James Fielding 18. March 2010 13:53

Intro | Part 1 | Part 2

So we're on the third instalment of this three-part tutorial series, where you and I are building an AJAX Contact Us form in ASP.NET, a couple of different ways. If you need a recap, here are the links to the introduction and the partial-page updates method. In this article we’re going to put the "less is more" principle into action by initiating our network callbacks directly from client-side JavaScript code, and we'll also build an AJAX-enabled web service to handle our call. As in Part 1, I’m going to assume that you are comfortable using Visual Studio.

You can download the source files for this project AJAXEnabledContactForm.zip (45.6 kb).

So we're going from partial-page updates using the asp:UpdatePanel, to network callbacks through a web service using HTML controls. The main reason you'd go this way is to drastically reduce your data transfer between the client and server. And why is this? Well, for two reasons: First, unlike partial-page updates, we're not passing all the form's data back to the server, just the required parameters in an XML wrapper. Second, we're not executing the page's full life-cycle back on the server from the postback, either. So if you're looking for efficiency, this is the way to go.

We'll be continuing on with the project that we created in Part 1, which we called “AjaxEnabledContactForm”. Let's start with the our web service, which is going to provide the service methods that our Contact Us form calls. So I`ve created a new web service called "ContactUs.asmx". Since we've already seen the some of this code in Part 1, I'll give you the full page first, and then we'll walk through it.

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://xmlforasp.net")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class ContactUs
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function Submit(ByVal strEmail As String, ByVal strComment As String) As Boolean
        System.Threading.Thread.Sleep(5000)
        Return SendMail(strEmail, strComment)
    End Function

    Private Function SendMail(ByVal strEmail As String, ByVal strComment As String) As Boolean
        Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()

        mailMessage.From = New System.Net.Mail.MailAddress("myserver@mysite.com")
        mailMessage.To.Add(New System.Net.Mail.MailAddress("me@mysite.com"))
        mailMessage.ReplyTo = New System.Net.Mail.MailAddress(strEmail.Trim())

        'Set additional options
        mailMessage.Priority = Net.Mail.MailPriority.Normal
        mailMessage.IsBodyHtml = False

        'Set the subjet and body text
        mailMessage.Subject = "Contact Us Form from: " & strEmail.Trim
        mailMessage.Body = strComment

        'Create an instance of the SmtpClient class for sending the email
        'using web.config settings
        Dim smtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient()

        Try
            smtpClient.Send(mailMessage)
        Catch ex As System.Net.Mail.SmtpException
            Return False
        Catch ex As Exception
            Return False
        Finally
            mailMessage.Dispose()
        End Try

        Return True
    End Function
End Class

The nice thing about doing our Contact Us form through a web service is that we can have both as a separate applications in our production evironment, so if there is a problem in our main application, the service is still available for other applications, or vice-versa. More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , , , , , ,

AJAX | Web Development | ASP.NET

Build an AJAX Contact Us Form using partial-page updates in ASP.NET

by James Fielding 12. March 2010 20:13

Intro | Part 1 | Part 2

As promised in the intro of this three-part series, you and I are going to build an AJAX Contact Us form in ASP.NET, a couple of different ways. Today we’re going to look to Visual Studio’s built in ASP.NET AJAX controls to do dynamic partial-page updates, and we’ll leave client-side network callbacks through a web service for a future post. To keep things moving, I’m going to assume that you are comfortable using Visual Studio. If you need to brush up, there are some great tutorials at ASP.NET.

You can download the source files for this project AJAXEnabledContactForm.zip (46 kb).

To start, I created a new AJAX Enabled Web Application in Visual Studio (you can find the free Visual Studio Express Edition here). I called the project “AjaxEnabledContactForm”, but you can call it whatever you want.

Next, I implement a Specified Pickup Directory method to test our contact form, and allow our web app to save notification emails to our c:\Temp\ folder. You can find the specifics of adding this to your own project in my post on The SMTP Alternative, but to keep this short, the code you need to add to your web.config file is as follows:


<configuration>
    ....
    <system.net>
        <mailSettings>
            <smtp deliveryMethod="SpecifiedPickupDirectory">
                <specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\" />
            </smtp>
        </mailSettings>
    </system.net>
    ....
</configuration>

Now, we need a page for our Contact Us form. I created a new page, called it "PartialPageUpdate.aspx", and added the following content to the body. More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , , , , ,

AJAX | Web Development | ASP.NET

Test sending email on Localhost in ASP.NET: The SMTP server alternative

by James Fielding 4. March 2010 09:43

Out of the box, Visual Studio is a wonderful environment for creating and testing ASP.NET applications. This includes Microsoft's free Express Edition, which is, as some of you know, a great place to start building sites. One thing that can be challenge to test are a site's email related subroutines. A standard and effective approach is to configure the SMTP server on your test machine. Unfortunately, if you send a project to somebody that doesn't have the identical SMTP test environment set up (which is pretty much never), you're going to have problems.

If you only need to test that your project can create an email, an alternative is to use the Specified Pickup Directory method, which simply has your test environment save the email, instead of actually sending it. To accomplish this, you need to add or replace the default mail settings in your project's web.config file:


<configuration>
    ....
    <system.net>
        <mailSettings>
            <smtp deliveryMethod="SpecifiedPickupDirectory">
                <specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\" />
            </smtp>
        </mailSettings>
    </system.net>
    ....
</configuration>

As you can probably guess, you can change the pickup directory for your email to anything you want, but take note: The directory has to exist, otherwise you'll get an error. This is particularly important if you are sending your project to somebody else, and don't want them to be stuck debugging your application. So, the temp folder is actually a decent place to store and access test emails.

The great thing about using the Specified Pickup Directory method is that you can use your production email settings throughout the project, and simply swap out the web.config mailSettings when your done testing. You can also send your email enabled projects to somebody else and have it work as expected.

Specified Pickup Directory is not a silver bullet, because sometimes you actually do want to do a test send, as opposed to just saving the email. However for most situations, particularly preliminary testing, this method will probably fit your needs.

Happy emailing,
James Fielding

kick it on DotNetKicks.com
Shout it

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , , , , , , ,

Web Development | ASP.NET

Build an AJAX Contact Us form in ASP.NET

by James Fielding 26. February 2010 13:47

Intro | Part 1 | Part 2

When it comes to building a Contact Us page in ASP.NET, then a page with a form tag, some text boxes, and a submit button is the classic and straightforward way to go. If this isn’t what you want to hear, then you’ve come to the right place.

Sure, a simple form may be the easiest, and arguably a more secure way of collecting user feedback, but it just doesn’t have that AJAX sparkle...and what’s the fun in that?!! Over the next two blogs, I’m going to be building an AJAX Contact Us form in ASP.NET using two different methods:

  1. Using Visual Studio’s built in ASP.NET AJAX controls to do dynamic partial-page updates.
  2. Using client-side network callbacks through a web service.

Just a couple of disclaimers before we start: I’m going to keep this as simple as possible, so let’s just say that the UI design is basic, the database/email hookup will be incompete, and we won’t be dealing with any major security concerns. So you’ll obviously want to bolster things before you drop this into a production environment. The point of this is not to provide an enterprise-class solution, but to give you a step-off point to building a great system. More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , , , ,

Web Development | ASP.NET

Referencing external URLs in your web.sitemap in ASP.NET

by James Fielding 23. February 2010 09:57

In ASP.NET, we often use site maps to set up navigation, particularly for menus. By default, the ASP.NET  site-map provider  uses the "Web.sitemap" file. Here is an example of this file for a simple site:


<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
    <siteMapNode title="Home" description="Home" url="~/default.aspx">
        <siteMapNode title="Services" description="Services we offer" url="~/Services.aspx">
            <siteMapNode title="Consulting" description="Consulting services" url="~/Consulting.aspx" />
            <siteMapNode title="Support" description="Supports plans" url="~/Support.aspx" />
        </siteMapNode>
        <siteMapNode title="About Us" description="About Us" url="~/AboutUs.aspx">
            <siteMapNode title="Company" description="Our people and offices" url="~/Company.aspx" />
            <siteMapNode title="Blogs" description="Blogs from us to you"
              url="http://blogs.mysite.com/default.aspx" />
        </siteMapNode>
    </siteMapNode>
</siteMap>

So our basic menu will look like this: More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , ,

Web Development | ASP.NET

Stop Web.Config settings inheritance in ASP.Net

by James Fielding 7. February 2010 19:16

Have you ever been left scratching your head after getting an error like this:

Configuration Error
Parser Error Message: Could not load file or assembly 'MyUnrequiredAssembly' or one of its dependencies. The system cannot find the file specified. (C:\Inetpub\wwwroot\child\web.config line 89)

It’s common to have child sub-applications under the root application in an ASP.NET web site. It’s also common to have inheritance problems in a child because of what’s in the root application’s web.config file. To stop the child application from throwing a configuration error, you’ll often find that the previous developer has added assemblies to the GAC, or to every child application’s /bin folder in addition to the root folder’s /bin. You’ll also see similar stop-gap fixes with other resources, particularly in the App_Theme folder. Fortunately, if you are running at least .NET 2.0, or better, there’s a number of ways to fix things that won't throw the next guy working on the site for a loop.

The simplest way to handle this is to:

1. Remove the offending assembly in the system.web section of the child application's web.config file.


<compilation>
    <assemblies>
        <remove assembly="MyUnrequiredAssembly" />
    </assemblies>
</compilation>

If you can't seem to get rid of the offending assembly, check for httpModules:


<httpModules>
    <remove name="MyUnrequiredAssembly" />
</httpModules>

Sometimes, it is easier to start the child application with a clean slate. In that case: More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , ,

Web Development | ASP.NET

Using hCard Microformats for SEO (Search Engine Optimization)

by James Fielding 4. February 2010 13:09

Yesterday, I attended a training session, where Derek Brown from Pronto Marketing shared some advanced strategies for SEO with us. Derek’s presentation was great…amazing in fact. One of the items that he breezed by, but seemed to really emphasize, was hCards and how Google and Microsoft have really starting to embrace microformats in general. I’d heard about microformats before, but had not really taken the plunge. Having said this:

Microformats are a practical way to make data items (such as events, contact details or geographical locations) recognizable to Search Engines, without breaking existing page formatting that is easily read by humans. This is done by adding a set of "class" attributes that can be added to divs and spans in an HTML page to tag content with semantic meaning. For example, my hCard looks like a standard block of text:

James C. Fielding
Sciosoft Systems
1037 Langford Rd.
Baysville, ON, P0B 1A0 Canada
705-571-1123

To get this, I used the following HTML:


<div id="hcard-James-Fielding" class="vcard">
  <a class="url fn n" href="http://www.sciosoft.com">
    <span class="given-name">James</span>
    <span class="additional-name">C.</span>
    <span class="family-name">Fielding</span>
  </a>
  <div class="org">
    Sciosoft Systems</div>
  <div class="adr">
    <div class="street-address">1037 Langford Rd.</div>
    <span class="locality">Baysville</span>,
    <span class="region">ON</span>,
    <span class="postal-code">P0B 1A0</span> 
    <span class="country-name">Canada</span>
  </div>
  <div class="tel">
    705-571-1123</div>
</div>

Adding this small amount of markup can have significant SEO results. Moreover, you can style this block with CSS by using the class names directly, or by adding a second styling class like this to any of the tags: More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: , ,

Web Development | SEO

Stopping a Virtual PC image from synchronizing the date with your host OS

by James Fielding 3. February 2010 10:53

“What will happen if the date/time on a machine is reset or is in a different time zone?” is a question that we sometimes run into, particularly from professionals whose documents are particularly date/time sensitive. Fortunately, this question can easily be handled by setting up one or more virtual machines.

Having said this, out of the box, Virtual PC virtual machines synchronize their date with the date of the hosting operating system. This means that no matter what control panel you alter in the guest OS, the date/time reverts back to the host OS settings, which can be really frustrating. To prevent this default action from occurring, you can add the following XML section to the .VMC file for the image that you’d like to desynchronize:


<integration>
    <microsoft>
        ....
        <components>
            <host_time_sync>
                <enabled type="boolean">false</enabled>
            </host_time_sync>
        </components>
        ....
    </microsoft>
</integration>
More...

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags: ,

Virtualization | Virtual PC

Welcome to ScioSoft's Community Blog

by James Fielding 28. January 2010 01:15

Welcome to ScioSoft's Community Blogs. The intent of this site is to showcase Information Technology (IT) topics specific to business, as well as the developers who support them.

The posts on this site are from our Business IT System Integrators & Developers who will post regularly, write informatively, and can draw on a wealth of real-world development experience in tailoring enterprise business solutions for the little guy – small and mid-sized businesses.  To test the waters, we’re going to start small, so we’ll begin with me, but we will be adding more contributors as we go along.

Please use common sense when commenting, and follow these simple guidelines:

  1. These blogs are intended solely for articles about business IT by and for small and mid-sized businesses. That means professionals, garage startups, and students can comment -- as long as all your comments are related to business IT.
  2. Feel free to repost content from your own personal comments, and note that Sciosoft Systems Inc. makes no claim to ownership of user-submitted materials. We just want to highlight great writing about business IT. That said, you may not post material you did not write, or that you do not have full permission to reprint.
  3. Please refrain from posting inappropriate comments that will later be removed. Use your best judgment, and please steer clear of pornographic imagery or excessive profanity; the line should be pretty clear in most cases! In addition, we would ask that your comment does not wholly advertise products or services at the exclusivity of anything else. Our goal is absolutely not to modify or censor material, but illegal or highly objectional content will be necessarily excised.
  4. Also, you should note the blogs disclaimer that can be found at the bottom of the right hand column under “Disclaimer”. It reads, “The opinions expressed herein are the personal opinions of the contributors and do not necessarily represent the views of Sciosoft Systems Inc.” Although these blogs are located on ScioSoft’s servers, the content is not necessarily reviewed, verified or certified by Sciosoft Systems Inc. These blogs have been made available as a forum for the personal opinions of contributors in their personal time. As such, Sciosoft Systems Inc. will not be held liable or responsible for any damages or costs incurred by acting on inaccurate or incorrect information posted on this site.

By combining ScioSoft’s existing position as a leading Business IT Systems Integrator with the many industry insiders and business owners already publishing their own thoughts about business IT, we believe ScioSoft’s Community Blogs will help open new lines of communication and discussion among the community. Please consider helping us achieve that goal!

Thanks for your interest,

James Fielding

Sciosoft Systems is a Canadian web design & development company based in Muskoka, which is in central Ontario. We provide ASP.NET website & Windows Server application development services to small and medium-sized business, as well as local government and not-for-profit groups. If you have a website project you’d like to discuss, please visit us at www.sciosoft.com.

Share |

Tags:

General | Welcome

RecentComments

Comment RSS

The opinions expressed herein are the personal opinions of the contributors and do not necessarily represent the views of Sciosoft Systems Inc.