Friday, May 27, 2011

Remove whitespace from your ASP.NET page

In a normal webpage there is a lot of whitespace. We put it there in form of tabs and carriage-returns in order to make the document more maintainable and easier to read. But it has its price in terms of adding to the overall weight of the document in kilobytes and it takes longer for the browser to render a page with a lot of whitespace. This is especially true for IE6, which renders whitespace a lot slower than its counterparts.
The problem is, we don’t want to write html without whitespace. It would make it impossible to maintain. What we are looking for is an automatic way to filter the whitespace at runtime. In ASP.NET this is easy. You can override the page’s Render method and do the filtering in there. We also want to be able to turn the filtering on and off easily, because when we develop we often want to look at the rendered html code and make sense of it.
Here is an example that does just that. It overrides the render method of the page and is turned on/off in the web.config.
Implement this on the aspx page or even better on the master page if you use ASP.NET 2.0:
//Add this to the top of the page
    using System.Web.UI;
    using System.Text.RegularExpressions;
//Overrides the Render method
    protected override void Render(HtmlTextWriter writer)
        using (HtmlTextWriter htmlwriter = new HtmlTextWriter(new System.IO.StringWriter()))
            string html = htmlwriter.InnerWriter.ToString();

            if ((ConfigurationManager.AppSettings.Get("RemoveWhitespace") + string.Empty).Equals("true", StringComparison.OrdinalIgnoreCase))
                html = Regex.Replace(html, @"(?<=[^])\t{2,}|(?<=[>])\s{2,}(?=[<])|(?<=[>])\s{2,11}(?=[<])|(?=[\n])\s{2,}", string.Empty);
                html = Regex.Replace(html, @"[ \f\r\t\v]?([\n\xFE\xFF/{}[\];,<>*%&|^!~?:=])[\f\r\t\v]?", "$1");
                html = html.Replace(";\n", ";");

and add this to the web.config appsetting section:
"RemoveWhitespace" value="true"/>
It's as easy as that and the overhead is reasonable. I use this on the most of the websites I build and have never noticed any negative impact in any way.

Source : -

Wednesday, May 11, 2011

10 Highly Effective Free Ways of Generating Traffic

In this highly digital world, targeted traffic to your website could not be any more valuable. You can have the best, most accessible, beautiful designed website in the world... if no one visits it you might as well just take it down. Does this sound like the old "If a tree falls in the woods does anyone hear it" phrase? That is because it is not that far off.
If you have a huge advertising budget getting targeted traffic is not that difficult. There are countless tools available for identifying the right markets and you can simply write checks to your hearts desire. However most of us are placed in situations where we (or our clients) simply can not afford to spend tens of thousands of dollars on internet advertising.
Luckily, if you know the right strategies you can get plenty of targeted traffic with out spending any hard cash.

1. Build an E-mail List

Building an e-mail list is something that many of us have seemed to have forgotten about. It may be due to the association with spam, or that it has been around so long, or maybe social media and RSS seem like a better option. E-mail offers a very unique difference and advantage however. First you have the ability to send specific e-mails and messages to specific groups and segments of your audience (where RSS is an all or nothing approach), but additionally you tend to have a more captive audience which results in higher response and conversion rates.

2. Focus on Organic Search

Organic Search Engine Optimization (SEO) has the capability to pull in large amounts of traffic with out having to spend a dime (in theory). Organic search is simply the unpaid listing of websites that show up when someone performs an internet search on a site such as Google, Yahoo or Bing. With 80% of all transactions starting with an internet search, not only do you have an audience that is ready to buy... it has the potential to bring in more traffic that almost any other approach available.
While we would all like to get more organic traffic it often is easier said than done. It is important to keep in mind that there is no way to trick your way to good rankings. The best practice is always to create high quality valuable content and ensure your website is built in a way that is search engine friendly. Keep in mind that when you are focusing on organic traffic getting high quality links with targeted anchor text tends to be most effective (for example, DIY Solar Energy)

3. Social Media

Social Media is the use of employing sites and media that allow you to connect with other people on a social level. The common examples would be Twitter, YouTube, Facebook and Linkedin. These sites let you connect and converse with other users who have similar interests as you. Because all websites have some overarching theme or topic, you can connect with people who are also interested in the topic. This gives you the opportunity to build awareness of your site/product/service with your audience on a personal level which is much more effective than on a push media level.
An important note about social media. Make sure anything you do, publish or say on these networks is done in a way that actually adds value to someones day. If you are simply signing up to spam links to your site you are likely to have sub-par results.

4. Develop Some Public Relations

With so much focus on digital media public relations has lost a lot of the attention that it used to hold. Public relations is a valuable part of any marketing mix and it is an approach to building awareness and traffic that shouldn't be ignored. Especially considering it can be a low cost (or no cost) solution. There really are two areas in which we can benefit from public relations, through traditional forms of media and new forms of media.
While there are many different facets of PR, where you stand to gain a lot of new traffic is by having stories and articles written about your website.


Back before the internet became what it is today, companies would send a small one page write up with "news worthy" content regarding their company to any relevant media sources. These went out to newspapers, magazines, journals, etc... This write up was called a "press release" and simply covered the "who, what, when, why and how" of the story. Despite the fact that the internet is changing the way people consume news, it is still an effective way of building awareness about your website and/or company.
There have been plenty of studies and reports that show a direct correlation between traditional media mentions and website traffic. Even if your website isn't listed in the article you will find more branded searches for your website (and thus more traffic). If you know that you are going to be covered you can also try and capitalize on the increase in traffic and offer special discounts or personalized messages.
The process is fairly simple. Round up any related publications and look for the news contacts, almost every publication will have an e-mail where you can submit news. Write up a short press release and distribute it to the list you created previously. Don't be afraid to call up the media and pitch the story to them a few days after you have sent the release.


This process doesn't have to be limited to offline publications. There are lots of industry blogs and websites that regularly post content and news to an audience consisting of your target market. While the concept is similar (get an online publication or blog to talk about you, your product, your company, etc..) it tends to be slightly different in approach. In most cases getting articles and news published can be a bit trickier as you are not always working with professional journalists who always need that next story.
When pitching stories to bloggers or online publications you may need to spend more time developing a relationship with the authors first. Additionally finding a list of relevant blogs can be a bit more tricky and require more searching. The more open and honest you are about the situation the better your results will be. It is unnecessary to write a formal press release (and ineffective), focus on starting a conversation with the author instead.

5. Add Value to Other Sites

Ok "Web 2.0" might be a cliche term, but there are a countless websites that thrive on user participation and contribution. I assure you that there are some related to your industry or that consist of your target market, as people naturally want to connect and discuss things that are important to them. Some industries and topics may be harder to find than others, but if you are listening there are people talking.
Once you have found these types of sites, take a little bit of time every week to add value to them through participation. Over time the users will begin to become familiar with you and trust you. By offering your knowledge you will build awareness, good will and trust for your company/website/profession. Additionally most of these sites will even let you have a profile or signature that can contain a link (or several) to your website so you don't have to be so direct about your motives.
The more you participate and the more you contribute the more you will get out of this technique.

6. Get Others Involved

Sometimes the best way to build awareness and traffic is through word of mouth. Word of mouth is actually one of the most effective forms of marketing online and off. Not far behind word of mouth in terms of effectiveness is celebrity endorsement. This method can drive traffic to your website by using both of these proven techniques. When you get other people involved in your website (either as guest bloggers, giving them an interview, etc...) you are doing two very powerful things. First you are actually giving people a small portion of ownership in what you are doing. When they invest the time to contribute and assist the site they buying into the idea that it is worth their time and effort. Because of this they are going to be much more likely to want your website to succeed and thus tell other people. If nothing else they will likely link to their contribution and tell people about it.
Additionally by having a well known figure contributing to your website you are getting their endorsement and it can boost your credibility significantly (even to the point of matching their own). This subconsciously will resonate with users and put the site at a higher status than they would previously, making them much more likely to share your site, contribute to the site and return for future visits.

7. Syndicate Your Content

Chances are if you are looking for more traffic there are at least a handful of other sites on the web that cover the same (or similar) subjects that you are. By creating high quality content you can offer a win/win situation. Approach popular websites and offer to publish (or syndicate) your articles on their site. They win by providing relevant content to their readers with out having to perform the work of creating it and you can build awareness / traffic to your site through an article byline.
If you can't find any websites that will bite you could always submit your articles to article directory sites. They often have huge mailing lists on various topics and tend to rank fairly well themselves.

8. Contests For Your Services

Contests have always been a great way to build awareness and interest. After all who doesn't like wining something for free? Since we are talking about free ways to generate traffic purchasing an item to give away is out of the picture. Sure you might be able to find something you already have to give away but how likely is that? Instead offer up your expertise. Chances are you have skills or knowledge that is valuable to other people or companies. By offering a contest for the services you don't have to spend any additional capital and build awareness for all of those people who previously didn't know about your expertise but could use your help.
This is a perfect time to build your e-mail list. Ask those who are signing up for your contest if they would like to be entered into your newsletter for future opportunities and giveaways.
If you don't want to do a contest you could also do a free seminar or webinar, both of which can drive a lot of traffic and attention to your site as well.

9. Be Remarkable

Supreme marketing guru Seth Godin often talks about the importance of being remarkable. The idea is that if you are "the best in the world" at something it will naturally market for you. An important part of achieving this status is picking a very specific and narrow niche or specialty. If you have a content focused website, what very specific topic can you cover that you can do better than anyone else in the marketplace? If you run a service company, what very narrow and specific niche can you server better than any of the other companies in the market?
By focusing your attention on becoming the best at this narrow specialty you will become remarkable and an expert. Your demand will increase dramatically and people will start finding your site naturally. This actually is more effective and will generate more traffic than if you were to try and be "good" in a market that is already saturated with those who can do a better job than you.

10. Start a Group or Organization

Through out human history we have always desired a sense of belonging and community.It doesn't take much looking to find a group of people who are interested in the same things that you are. Start a weekly meet up, tweet up, chat up (if it is virtual), forum, digest, etc... that gets the group of people together to talk and discuss the issues. You would be surprised at how quickly a group like that can grow. As the founder and head of the group or organization you will receive a lot of notoriety and interest. It will also give you great opportunities to have links and advertisements for your company or website through out areas in which members interact.


There are lots of different ways to drive traffic to your website with out spending much (or any) money. Sometimes they are more effective than paid methods. The general rule of thumb though is that traffic tends to be high involvement and low cost, or low involvement and high cost. Search Marketing is a good example of this - where pay per click can get you traffic very quickly and with out much in terms of time investment, organic rankings can take significantly more work and take much longer but at a much lower cost.
It is important to understand what techniques, tactics and strategies are going to be most effective for any given situation. Blindly trying them all is not going to work very well, take the time to think through and plan your approach in building traffic.

Search engine optimization (SEO)- Things todo and not todo

Search engine optimization (SEO) is the process of improving the volume and quality of traffic to a web site from search engines via "natural" ("organic" or "algorithmic") search results for targeted keywords. In this article find out how to do basic SEO, code search engine friendly pages and how to do a basic promotion of your site.

Things to do
  • Keywords in URL
    For example use whole words – keywords to best describe your site. Don’t rely on this if you don’t have keywords in other parts of your site.
  • Keywords in <title> tag
    This shows search results as your page title, so this is one of the most important things and it shouldn’t be long 5-6 words max, and use keyword at the beginning.
  • Keywords in anchor texts
    Also very important, especially for the anchor text, because if you have the keyword in the anchor text in a link from another site, this is regarded as getting a vote from this site not only about your site in general, but about the keyword in particular.
  • Keywords in headings (<H1>, <H2>, etc. tags)
    One more place where keywords count a lot. But beware that your page has actual text about the particular keyword.
  • Keywords in the beginning of a document
    While coding your page put your main content before side bar. Because this also counts, though not as much as anchor text, title tag or headings
  • Keywords in <alt> tags
    Spiders don't read images but they do read their textual descriptions in the <alt> tag, so if you have images on your page, fill in the <alt> tag with some keywords about them.
  • Anchor text of inbound links
    This is one of the most important factors for good rankings. It is best if you have a keyword in the anchor text but even if you don't, it is still OK.
  • Origin of inbound links
    It is important if the site that links to you is a reputable one or not. Generally sites with greater Google PR are considered reputable and the .edu and .gov sites are the most reputable
  • Links from similar sites
    Having links from similar sites is very, very useful. It indicates that the competition is voting for you and you are popular within your topical community.
  • Metatags
    Metatags are becoming less and less important but if there are metatags that still matter, these are the <description> and <keywords> ones.
  • Unique content
    Having more content (relevant content, which is different from the content on other sites both in wording and topics) is a real boost for your site's rankings.
  • Frequency of content change
    Frequent changes are favored. It is great when you constantly add new content but it is not so great when you only make small updates to existing content.
  • Site Accessibility
    Another fundamental issue, which that is often neglected. If the site (or separate pages) is unaccessible because of broken links, 404 errors, password-protected areas and other similar reasons, then the site simply can't be indexed.
  • Sitemap
    It is great to have a complete and up-to-date sitemap, spiders love it, no matter if it is a plain old HTML sitemap or the special Google sitemap format.
Things not to do
  • Keyword stuffing
    Any artificially inflated keyword density (10% and over) is keyword stuffing and you risk getting banned from search engines.
  • Keyword dilution
    When you are optimizing for an excessive amount of keywords, especially unrelated ones, this will affect the performance of all your keywords and even the major ones will be lost (diluted) in the text.
  • Single pixel links
    when you have a link that is a pixel or so wide it is invisible for humans, so nobody will click on it and it is obvious that this link is an attempt to manipulate search engines.
  • Cross-linking
    Crosslinking occurs when site A links to site B, site B links to site C and site C links back to site A
  • Duplicate content
    When you have the same content on several pages on the site, this will not make your site look larger because the duplicate content penalty kicks in. To a lesser degree duplicate content applies to pages that reside on other sites but obviously these cases are not always banned
  • Doorway pages
    Creating pages that aim to trick spiders that your site is a highly-relevant one when it is not, is another way to get the kick from search engines.
  • Cloaking
    Cloaking is another illegal technique, which partially involves content separation because spiders see one page (highly-optimized, of course), and everybody else is presented with another version of the same page.
  • Invisible text
    This is a black hat SEO practice and when spiders discover that you have text specially for them but not for humans, don't be surprised by the penalty.
  • Illegal Content
    Using other people's copyrighted content without their permission or using content that promotes legal violations can get you kicked out of search engines.
  • Flash
    Spiders don't index the content of Flash movies, so if you use Flash on your site, don't forget to give it an alternative textual description. And also don’t have just flash home page without HTML one.
  • Frames
    Frames are very bad for SEO. Avoid using them unless really necessary.
  • Redirects (301 and 302)
    When not applied properly, redirects can hurt a lot – the target page might not open, or worse – a redirect can be regarded as a black hat technique, when the visitor is immediately taken to a different page.
  • Bans in robots.txt
    If indexing of a considerable portion of the site is banned, this is likely to affect the nonbanned part as well because spiders will come less frequently to a “noindex” site.
  • Session IDs
    This is even worse than dynamic URLs. Don't use session IDs for information that you'd like to be indexed by spiders.