Change what the Google 404 Widget searches for - ASP.NET

by Jamie Snell 28. November 2008 11:01

We're using ASP.NETs custom error pages and I added the Google 404 Widget to our 404 custom error page. 
 
Googles 404 Widget is just some javascript that adds a google search box and some suggested pages that they may have been looking for. 
 
The file name for our custom error page was ~/FileNotFound.htm
 
The problem was since ASP.NET just redirects to the FileNotFound.aspx page it put 'File Not Found' in the search box.
 
This breaks the entire functionality of the 404 search widget. 
 
Using the following script it'll search using the wrong URL they typed in.  It's getting it from the AspxErrorPath query string item.
 
<style type="text/css">
#goog-wm
{
}
#goog-wm h3.closest-match
{
}
#goog-wm h3.closest-match a
{
}
#goog-wm h3.other-things
{
}
#goog-wm ul li
{
}
#goog-wm li.search-goog
{
display: block;
}
</style>

<script type="text/javascript">
function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
 
var GOOG_FIXURL_LANG = 'en';
var GOOG_FIXURL_SITE = 'http://www.SiteDomain.com/';
var GOOG_FIXURL_URL = 'http://www. SiteDomain.com' + querySt('aspxerrorpath'); 
</script>

<script type="text/javascript" src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Launched New Site

by Jamie Snell 28. November 2008 08:40

 

We've launched a new site, OmahaBarCard.com.

With it you can get deals from over 72 bars in Omaha, Nebraska.

We're going to be adding more later such as image galleries and event calendars.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

AT&T's 3G Network Comes to Lincoln, Nebraska

by Dustin Clonch 23. November 2008 14:27

At&t began offering their high speed cellular 3G data network today in Lincoln.  Much faster than the existing Edge data network, 3G allows wireless users to surf the web and download music and files at speeds up to 14.4 Mbits on the downlink and 5.8 Mbits on the uplink.  This new service opens up a wide range of new capabilities for iPhone users who own the latest 3G enabled version of the popular handset.  At&t had promised Lincoln and Omaha iPhone users that it would have 3G service in place by the end of 2008, effectively delivering the service in Lincoln a full month ahead of schedule.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen