Archive for the ‘Technology’ Category

How-to: 301 Permanent Redirect with ASP.NET 4 – Response.RedirectPermanent()

Friday, July 9th, 2010 by Brent

During the process of migrating development over to the .NET 4 Framework there have been noticeable improvements.

One of the newest improvements is used quite often, Response.RedirectPermanent(). This new feature does a permanent redirection from a requested URL to a specified URL.

For a quick flashback to how this was previously completed review the code below:

/*
 * Previous 301 Permanent Redirect
 * */
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", "NewPage.aspx");

How you implement the new 301 Permanent Redirect is simply Response.RedirectPermanent(“URL-path-goes-here”). Here is an example with the new way with fewer lines of code.

/*
 * .NET 4 301 Permanent Redirect
 * */
Response.RedirectPermanent("NewPage.aspx");

By implementing 301 redirects it is a good practice to inform search engines that content has moved to a new location. Here are examples where Force 5 is involved with 301 redirects:

  • a web page that have moved
  • a Web page that has been removed
  • web page content that has been consolidated with another web page
  • non-www permanent redirect to the www (or vice versa)

How-to: Adding META Keywords & META Description with ASP.NET 4

Tuesday, July 6th, 2010 by Brent

In a previous post I showed how-to add specific page keywords & descriptions while using ASP.NET with Master Pages. Compared with the latest ASP.NET 4 version, this technique was not coder friendly.

In ASP.NET 4 adding page keywords and descriptions is as easy as this shown below.

    protected void Page_Load(object sender, EventArgs e)
    {
        // page keywords
        Page.MetaKeywords = "keywords go here...";
        // page description
        Page.MetaDescription = "description go here...";
    }

Overall, page keywords & descriptions are still important for SEO success along with page titles and page content. If you need any help with your website search rankings please feel free to contact Force 5 for some guidance.

State of HTML 5

Wednesday, June 9th, 2010 by Nevin McElwrath

If you are a web developer or familiar with web technologies, there’s no doubt you’ve heard about HTML 5 and the “next level” of web design and functionality. It’s morphed into a buzz term that has been thrown around a lot lately. Between Apple’s spat with Adobe over Flash and the latest browsers touting HTML 5 compatibility, there’s still a lot to know about the always evolving markup language of the world wide web.

First off, what is HTML 5? Simply put, it’s the next version of HTML (HyperText Markup Language) that “aims to reduce the need for proprietary plug-in-based rich internet application technologies such as Adobe Flash and Microsoft Silverlight”. [credit: Wikipedia] Another standard that is in the draft stage is CSS3, or version 3 of the Cascading Style Sheets spec, meant to eliminate styling woes of version 2 and “offer a more robust layout feature set”. [credit: Wikipedia] I agree to the argument that the CSS spec is more meant for styling rather than layout, but that’s another lengthy blog entry. :)

What does this mean for web developers? When implementing HTML5 paired with CSS3, it means more options to achieve the look or functionality you are after – with the use of web standards, and not of proprietary plugins such as Flash or Silverlight.

The new specs also eliminate the need for CSS and Javascript hacks to achieve, for example, rounded corners, drag and drop, animations, gradients without images, embeddable fonts, support for SVG (scalable vector graphics), a standard video playback method, and others. Of course this all depends on your browser of choice. As of this blog entry, only Chrome, Safari, Opera and Firefox support the current working draft of HTML 5 and CSS3.

What does this mean for the end user? For one thing, it means more engaging design and functionality on many sites. While this is, to an extent, entirely subjectable, it opens the door even wider for a diverse variety of sites to differentiate themselves from the rest. This to me, is very exciting. Creativity will play an even bigger role in site production.

HTML 5 people in-the-know:

To check your browser for HTML 5 compliance, try the HTML 5 test.

As always, Force 5 is on the bleeding edge of HTML 5 and what it offers to the web.

Is Your Website Customer-Centric?

Friday, May 21st, 2010 by John Jambor

In case you haven’t noticed the web is changing. There is a huge movement underway toward clean, simple, user friendly websites that promote productivity and, consumer interaction. The average consumer doesn’t care how creative a design team you have or, how technically advanced your development team is. They want information. Honest, peer driven information.

Whether a potential customer is at your site to buy a product, comment on your organization, read reviews, download a podcast or, read your latest blog entry, it’s your job to keep them interested and coming back. This is what customer-centric website design is all about.

So what is a customer-centric website?

Simple.  A customer-centric website focuses on your customers and what they want. Today’s online consumer is not interested in your company, products or services – they are interested in themselves. A customer-centric websites is structured so the customer can easily find what they want or get answers to their questions. By focusing your website on customer benefits and, ensuring a unique user experience, you will not only increase loyalty you’ll generate the much coveted word-of-mouth advertising; both key drivers of online sales.

There are a few basic steps you can take to get started on the road to a customer-centric website
• Clearly define your product or service and how customers will benefit from it
• Make sure your contact information is never more than a click away
• Clearly organized and easily navigable site content
• Place links in consistent locations and include them on every page
• Review your content for spelling and grammar mistakes
• Allow customer feedback on products, services and the site
• Make it easy for customers to get what they want
• Ask customers for a bare minimum of information to register or sign up
• Include in-depth, well written FAQ’s
• Make it easy for a customer to get support

A successful customer-centric website is created by meeting customers’ needs better than anyone else. If you focus every aspect of your website on meeting your customers’ needs you’re much more likely to remain a preferred provider. Remember, your customer is your best source of advertising. Give them what they want and they will tell the world.

Don’t get left behind.  Take the next step toward a true customer-centric website. Contact Force 5 today at 574-234-2060 or info@discoverforce5.com.

The little things to not forget about during development [Part: 2]

Friday, May 7th, 2010 by Brent

Sitemap.xml

What are Sitemaps and why are they important?

Sitemaps are a tool for developers to inform search engines about the website content that is available to be indexed. The sitemap protocol is made up of XML that contains a list of URLs, last modified dates, and page priorities for your website.

Here is a quick sample in simple form of a sitemap.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<urlset  xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”>
  <url>
  <loc>http://www.discoverforce5.com/</loc>
  </url>
  <url>
  <loc>http://www.discoverforce5.com/About/</loc>
  </url>
</urlset>

For more information on sitemap protocol and XML tag definitions visit: http://www.sitemaps.org/protocol.php#xmlTagDefinitions

Below you will see two optional attributes available to include in your sitemap. The new attributes you see will be <changefreq> and <priority>. As stated within the sitemap documentation:

  • <changefreq> refers to how often a page is likely to change even though search engines may not crawl that often.
  • <priority> refers to the priority related to other links/URL’s within your site.
<?xml version="1.0" encoding="UTF-8"?>
<urlset  xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9”>
  <url>
  <loc>http://www.discoverforce5.com/</loc>
  <changefreq>monthly</changefreq>
  <priority>1.00</priority>
  </url>
  <url>
  <loc>http://www.discoverforce5.com/About/</loc>
  <changefreq>monthly</changefreq>
  <priority>0.80</priority>
  </url>
</urlset>

For more information about sitemaps and more advance information head over to www.sitemaps.org.

Next steps – Submitting your sitemap to the search engines

Each search engine is different in how they approach webmasters in submitting sites. Here is a list of locations to submit your sitemap.xml to search engines:

Tying in both the sitemap.xml with robots.txt

In part 1 of this series discussing robots.txt, you can declare the location of your sitemap.xml file for web crawlers/bots. Here is an example what a Robots.txt would look like:

User-agent: *
Allow: /
Sitemap: http://www.yourdomain.com/sitemap.xml

A quick refresher about the syntax above: “User-agent: *” is defining all bots and “Allow: /” is stating index all folders.

If you have multiple sitemaps you can declare them in your Robots.txt file. Here is an example in how to do so:

User-agent: *
Allow: /
Sitemap: http://www.yourdomain.com/sitemap-1.xml
Sitemap: http://www.yourdomain.com/sitemap-2.xml

In conclusion, having a sitemap.xml is not required for successful search engine indexing. Although, at Force 5 we believe it is beneficial when submitting your site to search engines that your site will be properly indexed. A great example is when a new site is going live where older pages may no longer exist in the same location. Even though search engines use other methods on indexing your site, using Sitemaps will in the end help the indexing process.

If you have any SEO needs or questions please give Force 5 a call.

Extreme Database Makeover

Wednesday, April 28th, 2010 by Force 5

Move…That…Database

Situation: Upgraded servers, so we needed to move database tables, views and stored procedures from a SQL Server 2005 machine to a SQL Server 2008 machine. We wanted to go through each table, view and stored procedure one by one in order to only move objects that are still in use. We needed a way to do that as accurately and quickly as possible.

Solution: We made use of the SQL Server Script Wizard. The Script Wizard generated the CREATE scripts for each object. We were able to either cut/paste and run the scripts we needed on the new server, or delete the scripts if we didn’t need them. This made the process seamless and straight-forward.

Details:

Accessing the Script Wizard

In SQL Server Management Studio right-click on a database. Go to Tasks > Generate Scripts… This will open up a wizard dialog box.

Using the Script Wizard

The first screen allows you to select the database you want to use. On this screen you can also fast-track to the finish by checking “Script all objects in the selected database”. This will create scripts for all Roles, Users, Schemas, Tables, Views and Stored Procedures. We won’t check that in this article, but that useful option is there if that is what you are trying to accomplish.

Choose Script Options

After you select your database and click Next you will come to an Options screen. We were able to use the default settings here. But there are some useful options to note.

  • Generate scripts for dependent objects(Default: False) – Use this to ensure dependent objects are also scripted for the objects that you select
  • Script Create(Default: True) - Cornerstone of this wizard. This enables creation of scripts for the objects you select.
  • Script Logins(Default: False) – Generates logins for the selected database
  • Script Object-Level Permissions(Default: False) – ***This is an important option*** Set this to True in order to generate the permission scripts (GRANT EXECUTE ON) if you are generating stored procedure scripts.
  • Script Data(Default: False) – Set to True if you want to script out INSERT statements for all data in selected tables.
  • Script Foreign Keys(Default: True) – Scripts foreign keys for tables selected
  • Script Primary Keys(Default: True) – Scripts primary keys for tables selected
  • Script Triggers(Default: False) – Scripts any triggers that are related to tables selected

Choose Object Types

This is where you select what object types you want to generate scripts for (Database roles, Schema, Stored procedures, Tables, Users, Views).

Following this you will be taken through screens for each object type you selected.  Here is where you select the specific objects whose scripts will be generated.

Output Option

Here you can either Script to a file, Script to Clipboard or Script to a New Query Window.  We scripted to a query window and that worked great.

Finished

Go to Finish and the wizard will generate the scripts that you selected.

Notes

The constraints and permission assignments are all located in the last section of the generated scripts.  This is to ensure that the objects have been created before trying to assign permissions to them.

MSDN Article: How to: Generate a Script

In Conclusion

This wizard is a powerful, yet simple tool that makes data migration more manageable.  Trying to do this task object by object would be very cumbersome and impractical.

If you are in need of any advice or have a data migration project that you need help with please feel free to contact us here at Force 5.

I Need a New Website – Now What Do I Do?

Wednesday, April 14th, 2010 by John Jambor

You finally decide your company needs a new website, but you have no idea who to call. You check the yellow pages, Google web design, ask friends and family, and you’re still overwhelmed with all the choices. Who do you call when your brother-in-laws sisters boyfriend will do the job for $500. “We Are Web Sites”, the best web shop on the internet, will build your site for $2,000 and, “The Interactive Agency” down the street wants ten times that amount for a website and an integrated marketing campaign.

It doesn’t matter if you’re an online expert who knows all the new technology or you know about this “World Wide Web thingy” that’s kind of cool, picking a company to build your website can be a daunting task. In the following article I will explain some of the key differences between a web shop and an interactive agency and what you should expect from both.

Your Brother-in-Laws Sisters Boyfriend

Don’t do it! No really; don’t do this. After months of stress and frustration (because the basketball game with his buddies was more important than working on your site) you will end up with a website that looks like, well, you paid $500 to your brother-in-laws sisters boyfriend to build. Remember your website is the face of your company to millions of online people. Is this the image you want to portray?

The Web Shop

There are several different types of web shops. There is the design centric shop, the technology centric shop and the canned – just add your own copy and pictures and have an online presence today – type of shop. With the design centric shop your site will look great. It will portray exactly what the designer thinks of your company. With the technology centric shop your site will have all the bells and whistles whether you use them or not, and with the canned shop you will be forced to form your site around their cookie cutter solution.

No matter which of the three “web shop” solutions you choose there are several constants you can be sure of. Your business needs, determining who your consumer is and what they are looking for, search engine optimization, and your overall marketing plan will not be considered. Now, I’m not saying these are bad designers and programmers. They are probably great at what they do. What I am saying is that they either don’t have the time, desire, or knowledge to create the true online tool your business and your customers deserve.

The Interactive Agency

The interactive agency approaches websites as an extension of your entire marketing plan. They focus on your brand, and integrating your digital marketing campaigns into your overall marketing plan. The starting point for any interactive agency is learning who you are, learning your competition and, understanding your consumer. The second step is information design. Interactive agencies take what they learned in the first step and organize it in a way that creates straight forward navigation, and presents information on your website to best meet your consumer’s needs. This is the heart of a consumer centric website. For a detailed look at consumer centric websites watch for my next blog. Step three consists of the actual site design and build. Interactive agencies utilize a team of highly skilled designers and programmers to create your website. The design team creates an aesthetic, yet simple to use, look and feel focused on keeping the consumer engaged. The programming team takes into account consumer usability, accessibility and, search engine optimization. When complete your website will pass all validation testing, and will be well guarded against common hacking practices.

The job of the interactive agency doesn’t end with completion of your website. Your Website is only the beginning, the creation of what should become the backbone of your entire marketing plan. Now it’s time to look at, among other things, social media, pay per click campaigns, banner ads, email campaigns, product specific micro sites, personalized URL’s (PURLS) and, integration of digital marketing into traditional marketing efforts. The interactive agency is never far away. As your strategic partner they will routinely review, test and recommend upgrades to ensure it remains up to date, relative in search engine results and, in compliance with the latest best practice recommendations.

So now you understand that yes, anyone can build a website but to get the most out of your marketing efforts an interactive agency is the best solution. To find out how your business could benefit from using a full service interactive agency call Force 5 today at 574-234-2060 for send us an email at info@discoverforce5.com to schedule your discovery meeting.

The little things to not forget about during development [Part: 1]

Friday, March 19th, 2010 by Brent

Robots.txt – Telling bots where to go and where not to

What is the robots.txt and why is the robots.txt file important?

The robots.txt file is placed in the root folder of your website. This file instructs search engine bots what can and cannot be indexed. All you need to do is to define some criteria of what can be indexed and what cannot.

Examples:

Below you will see “User-agent: *” which is defining all bots and “Allow: /” is stating index all folders.

User-agent: *
Allow: /

Here is a direct opposite to not allow indexing for all bots.

User-agent: *
Disallow: /

Not allowing indexing for your whole website would probably not be recommended. Although there can be special situations where you would want to block all. For example, if you are working on a ‘beta’ website that you did not want to get index. This would be the situation to use if you were not using an authentication process on the beta site to be able to view the site.

A few years ago when bandwidth was costly I ended up having to create a special rule to block my portfolio image folder. In this example you will see how disallow a folder for all bots.

User-agent: *
Disallow: /images/

For more information regarding robots.txt here are a few resources worth checking out:

Lastly, it should be noted the robots.txt is merely a recommendation than absolute. Meaning a bot can totally ignore the robots.txt rules that you have laid out. So if you have any important content that you need to keep from being indexed, it is a best practice to put login credentials on the folder storing that content to keep it from the bots.

If you need help with your robots or SEO please feel free to give Force 5 a call.

SQL Case Study – Convert data rows to columns

Friday, March 5th, 2010 by Force 5

We recently had a project that involved putting together a survey.  This survey was comprised of almost 150 questions.  As we brainstormed the best way to construct the data tables to store this information, the thought of a table with 150 columns made us cringe.  Time constraints also called for something we could put together relatively quickly.  We decided to create a table that stored each question as a row of data.  Then we made a table that referenced the primary key of the question table along with the user’s answer to that question.  So instead of having a table with 150 columns, we have one table with 150 rows and another table that stores a data row for each question answered on the survey.  Now if a question needs to be added or removed from the survey all that needs to happen is add or remove a row from the questions table.

It also made collecting the survey data through a ASP.NET Web Site a lot easier, but that can be a future blog topic.

All of that was a setup for displaying the following solution that we created.  In order to display the data correctly for reporting purposes we needed to be able to transform the 150 rows of data in the questions table into a table with that data as column names.  In simpler terms, we needed to convert a set of data rows in table columns in a temporary table. Then we needed to be able to populate that table with the data from the answers table.

Here is the solution we came up with using the power of a stored procedures in Microsoft SQL Server.

CREATE PROCEDURE [dbo].[Survey_Answers]
AS
BEGIN
	SET NOCOUNT ON;
 
	-- Declare variables
	DECLARE @QuestionID varchar(20), @sql varchar(MAX)
 
	-- Create empty temporary table with id column
	CREATE TABLE #tempTable (SurveyID int NULL)
 
	---- Insert Columns into pivot table ----
	-- Declare cursor to loop through table
	DECLARE curQuestions CURSOR FOR
	SELECT     QuestionID
	FROM         Survey_Questions
 
	OPEN curQuestions
 
	FETCH NEXT FROM curQuestions INTO @QuestionID
	WHILE @@FETCH_STATUS=0
	BEGIN
		-- Defines each column
		SET @sql = 'ALTER TABLE #tempTable ADD ' + @QuestionID + ' varchar(1024) NULL'
		-- Executes the command which creates the column in the temp table
		EXEC(@sql)
		FETCH NEXT FROM curQuestions INTO @QuestionID
	END
 
	-- Clean up cursor
	CLOSE curQuestions
	DEALLOCATE curQuestions
	---- End of Insert Columns section ----
 
	---- Insert id values into pivot table ----
	-- Create rows in temp table using IDs from Survey table
	INSERT INTO [#tempTable] (SurveyID)
		SELECT     SurveyID
		FROM         Survey
 
	---- Insert data into pivot table ----
	-- Loop through each row in Survey_Answers
	-- Update values in pivot table
 
	-- Declare variables
	DECLARE @SurveyID int, @QuestionID2 varchar(20), @Answer varchar(1024), @CurrentSurveyID int
 
	-- Initialize variables
	SET @CurrentSurveyID = -1
	SET @sql = ''
 
	-- Declare cursor to loop through table
	DECLARE curAnswers CURSOR FOR
	SELECT     Survey_Answers.SurveyID, Survey_Answers.QuestionID, Survey_Answers.Answer
	FROM         Survey_Answers INNER JOIN
						  Survey ON Survey_Answers.SurveyID = Survey.SurveyID
	ORDER BY Survey_Answers.SurveyID
 
	OPEN curAnswers
 
	FETCH NEXT FROM curAnswers INTO @SurveyID, @QuestionID2, @Answer
	WHILE @@FETCH_STATUS=0
	BEGIN
		IF @CurrentSurveyId&lt;&gt;@SurveyId
			BEGIN
				-- This will run at the end of a set of questions related to one survey
				-- And initializes variables for next set of questions
				IF @sql&lt;&gt;''
					BEGIN
						SET @sql = STUFF(@sql, LEN(@sql), 1, ' WHERE (SurveyID = ' + CONVERT(varchar, @CurrentSurveyId) + ');')
						EXEC(@sql)
					END
				SET @sql = 'UPDATE [#tempTable] SET'
				SET @CurrentSurveyId = @SurveyId
			END
 
		-- Update values in pivot table
		SET @sql = @sql + ' ' + @QuestionId2 + ' = ''' + @Answer + ''','
		FETCH NEXT FROM curAnswers INTO @SurveyID, @QuestionID2, @Answer
 
		-- This section takes care of the last row since it will not go through the IF @sql&lt;&gt;'' code above. Uses same code as that section
		IF @@FETCH_STATUS = -1
			BEGIN
				SET @sql = STUFF(@sql, LEN(@sql), 1, ' WHERE (SurveyID = ' + CONVERT(varchar, @CurrentSurveyId) + ');')
				EXEC(@sql)
			END
	END
 
	-- Clean up answers cursor
	CLOSE curAnswers
	DEALLOCATE curAnswers
 
	-- Select values from created table
	SELECT     [#tempTable].*, Survey.DateCreated
	FROM         Survey INNER JOIN
		[#tempTable] ON Survey.SurveyID = [#tempTable].SurveyID
	ORDER BY Survey.SurveyID 
 
	-- Clean up the pivot table
	DROP TABLE #tempTable
END

Let us know what you think about our approach or if you have any questions.

Adobe’s Flash In The Pan?

Monday, February 15th, 2010 by Nevin McElwrath

Adobe’s Flash has had a successful run the past few years. While the latest usage statistics show a slight decline, it still employs an impressive 95.89% browser install base as of Jan, 2010.

Some concerns have been raised lately with Apple’s decision not to include Flash support in it’s newly announced iPad (which runs a modified version of the iPhone OS). It’s been known that Apple’s iPhone does not support Flash. Apple blames Adobe’s buggy implementation of the Flash plugin as one of many reasons, causing poor battery life, security holes, application crashes, etc. While this is nothing new, the spotlight has again been focused on the lack of Flash on the iPhone OS.

Other reasons for Apple skipping Flash support that I think are much more important are HTML5 and the open standard of SVG.

One of the many critiques of Flash is that it is not an open standard. Many, including myself, believe closed platforms tend to stifle innovation and prohibit standard adoption – this, coming from a Flash developer. Also, the Flash plugin has long been sub par in performance on the Macintosh platform – but Adobe is finally taking small steps to remedy these issues. Is it too late?

In order for the web to move forward with a common standard and new innovative tools at hand for developers to use to create the next big thing, we NEED open standards. Period.

Adobe has an opportunity here to develop an HTML5 and SVG authoring tool, waiting to supplant Flash when it does eventually fade away along with proprietary video codecs and browser plugins.

As for myself, I welcome new venues and technologies to learn, as long as they allow for innovation, freedom and creativity in not only the resulted medium, but development as well. The next few years will be the litmus test for Flash in whether it has a place on the web or not. I believe strongly that openness on the web is the future and if a proprietary plugin expects to make the cut, some changes need to be made.

Robert Scoble has a good analogy:

Let’s go back a few years to when Firefox was just coming on the scene. Remember that? I remember that it didn’t work with a ton of websites. Things like banks, e-commerce sites, and others. Why not? Because those sites were coded specifically for the dominant Internet Explorer back then.

Some people thought Firefox was going to fail because of these broken links. Just like Adobe is trying to say that Apple’s iPad is going to fail because of its own set of broken links.

But just a few years later and have you seen a site that doesn’t work on Firefox? I haven’t.

What happened? Firefox FORCED developers to get on board with the standards-based web.

The same thing is happening now, based on my talks with developers: they are not including Flash in their future web plans any longer.

Adobe’s CTO, Kevin Lynch tackles this very topic in his blog post.

Admittedly, I would be sad to see Flash go. I love the control you have over your assets. As of right now, there really is no open alternative to that kind of control. jQuery and other JS libraries are just not there yet – but there is much promise. Combine jQuery with HTML5, SVG and time – you just may have a Flash killer.