By
Norty | June 11, 2010 09:01
In an aspx page you can't include the runat=”server” attribute for a script file.
Problem:
<script src=”~/scripts/jsfile.js” type=”text/javascript”><script>
Including the runat=”server” attribute will produce a compilation error on the page. A work around to this issue is to use the ResolveUrl() method.
Solution:
<script src=”<%ResolveUrl(”~/scripts/jsfile.js”)%>” type=”text/javascript”></script>
Utilizing the ResolveUrl() method will replace the instance of ~ in the string with the value of the application’s path; thus, providing the same benefit that runat=”server” gives you in style sheet links and image tags.
By
Norty | April 19, 2010 10:14
Sloan Implement Company needed a channel to keep visitors on their site and drive more search engine traffic. Their site was not ranking well on targeted, equipment related keyword searches because their equipment inventory was maintained on a separate domain.
For this situation NPS enhanced their website to browse, query, and view detailed information about the available equipment inventory held by Sloan Implement. The development added a fully automated system that constantly updates content to their site from an XML feed of their external managed equipment inventory data. NPS fetches the XML file, parses the data, and outputs the HTML for the display on www.sloans.com. The programming methodology ensures quick page load speeds and no site down time to refresh the XML data.
The new development greatly improved the performance goals desired by Sloan Implement. As compared to pre development web statistics, site operation improvements are as follows:
- Traffic from Search Engines: + 14%
- Visits: + 6%
- Pageviews: + 182%
- Pages/Visit: + 167%
- Bounce Rate: - 33%
- Average Time on Site: + 36%
On top of the website statistical improvements, the search engine ranking for the targeted, equipment related keyword searches also improved dramatically. For example, www.sloans.com went from not on the top 10 pages for the term “john deere 5055d” to page 1 on Google in less than a week. This improved search engine placement will help drive a greater number of targeted customers to their website.


The "search used equipment" development launched on April 8, 2010. Headquarted in Assumption, IL, Sloan Implement Company is one of the largest John Deere Dealerships in the world.
If you would be interested in discussing how Norlight Professional Services can assist you with a website redesign, SEO, usability improvements, or a custom application please contact us: nps@norlight.com; on Twitter @nps_norlight; facebook.com/nps.norlight.
By
Norty | April 14, 2010 10:35
Using jQuery to output the current year is a useful substitute when your website pages are done in HTML and not with server side languages like PHP or ASP. The following code demonstrates how to print the current year in HTML using jQuery.
First, you will need to reference a jQuery library in the <head> of your HTML. You can do this one of two ways:
- Link directly to the jQuery library on the jQuery code site
<script src=”http://code.jquery.com/jquery-1.4.2.min.js” type=”text/javascript”></script>
- Download a version of jQuery from the jQuery site (http://jquery.com) and relatively link to it from within your site
<script src=”/script/jquery-1.4.2.min.js” type=”text/javascript”></script>
With the jQuery library referenced you can now pull the current year and push it to an HTML element using some jQuery syntax. The below JavaScript grabs the current year and pushes the value to the “text” of the HTML element with the ID of “year”.
<script type="text/javascript">
var currentYear = (new Date).getFullYear();
$(document).ready(function() {
$("#year").text(currentYear);
});
</script>
Now we create the HTML element to receive the year value:
<p>Copyright <span id="year">TEXT</span> Company Name - All Rights Reserved.</p>
With this code in place, the year will be pushed to the TEXT position of the “year” span tag when the DOM is ready. This functionality is useful for elements such as copyright dates or other date representations that need to stay current.