Simple Marker Based on Address using the Google API
If you need to show a marker on a map based on an user inputted address, the Google API provides you a way. You can use the code below to create your own map you just need to get a Google Maps API key from Google Maps and insert it in line 6. In line 30 you can add html markup to modify how the call out box appears and what it contains. Just expand the code box below to check it out.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script src="http://maps.google.com/maps?file=api&v=2.x&key=YOUR GOOGLE MAPS API KEY FOR YOUR DOMAIN"
type="text/javascript"></script>
<script type="text/javascript">
var map;
var geocoder;
function initialize() {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(27.174858, 78.042383), 12);
map.addControl(new GLargeMapControl());
geocoder = new GClientGeocoder();
}
function addAddressToMap(response) {
map.clearOverlays();
if (!response || response.Status.code != 200) {
alert("Sorry, we were unable to geocode that address");
} else {
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml('The Place you entered: '+place.address + '<br>');
}
}
function showLocation() {
var address = document.forms[0].q.value;
geocoder.getLocations(address, addAddressToMap);
}
</script>
</head>
<body onload="initialize()">
<span class="style1">
<form action="#" onsubmit="showLocation(); return false;">
<p>
<b>Search for an address:</b>
<input type="text" name="q" value="" class="address_input" size="40" />
<input type="submit" name="find" value="Search" />
</p>
</form>
<div id="map_canvas" style="width: 500px; height: 500px"></div>
</span>
</body>
</html>
Using CDOSYS to Send Email with GoDaddy
CDOSYS is part of the System.Web.Mail namespace and is installed by default on Windows 2000 and Windows XP platforms. It replaces CDONTS for sending SMTP email messages and can be used with GoDaddy IIS 6 and IIS 7 Windows hosting accounts. The following code sample demonstrates how to create, format, and send email with GoDaddy.
The server “relay-hosting.secureserver.net” is used to send email from your GoDaddy hosted domain. You must populate the SmtpMail object’s SmtpServer property with this value. GoDaddy’s hosting servers allow for email attachments up to 30 MB.
// language -- C#
// import namespace
using System.Web.Mail;
private void SendEmail()
{
const string SERVER = "relay-hosting.secureserver.net";
MailMessage oMail = new System.Web.Mail.MailMessage();
oMail.From = "emailaddress@domainname";
oMail.To = "emailaddress@domainname";
oMail.Subject = "Test email subject";
oMail.BodyFormat = MailFormat.Html; // enumeration
oMail.Priority = MailPriority.High; // enumeration
oMail.Body = "Sent at: " + DateTime.Now;
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(oMail);
oMail = null; // free up resources
}
GoDaddy SQL Server Database Setup - Connection String
Before you upload your ASP.NET 3.5 application onto your GoDaddy hosting server, you need to modify the connection strings section of your web.config file.
<connectionStrings>
<add name=”Personal” connectionString=” Server=whsql-v04.prod.mesa1.secureserver.net; Database=DB_675; User ID=user_id; Password=password; Trusted_Connection=False” providerName=”System.Data.SqlClient” /> <remove name=”LocalSqlServer”/> <add name=”LocalSqlServer” connectionString=” Server=whsql-v04.prod.mesa1.secureserver.net; Database=DB_675; User ID=user_id; Password=password; Trusted_Connection=False” providerName=”System.Data.SqlClient” />
</connectionStrings>
NOTE: You may want to back up the web.config file on your local computer or simply comment out your current connection strings before you make any changes. This way, you can easily return to developing your application on you local computer.
This is an example of the connection strings section that will connect an ASP.NET 3.5 application to one of the GoDaddy SQL Servers:
NOTE: You can find your server name, database name, user ID, and password in the SQL Server section of your GoDaddy Hosting Control Center. These connection string values map to host name, database name, user name, and password, respectively. The user name and password values are those specified during SQL database (not hosting account) creation.
Small Business/ Personal kit download UPDATE
After not being available for a week or so, Microsoft has updated their download page for Starter Kits. There have been some additional kit added such as, BlogEngine.NET Starter Kit, Kigg Starter Kit, Dropthings.com, FlexWiki, Umbraco and Yet Another Forum.
You can download all of the starter kits from the ASP.net site
Download Small Business Starter Kit
If you are in need of the Small Business Starter Kit while Microsoft relocates their starterkits on the web you are welcome to download them here. Just click for the VB or the C# versions.
Download Personal Starter Kit
Microsoft has (temporarily?) disabled the links to download older starter kits from its website. As such, I am hosting them here until they are re-enabled. If you want the download the Personal Web Starter Kit just click here - Personal Web Starter Kit Download
If you are in need of another starter kit that is not available from the Microsoft website, leave a comment I will upload it if I can.
WordPress 2.51 and IIS error - Notice: Undefined index: REQUEST_URI in \wp-settings.php on line 81
The original wordpress 2.5 error mentioned in the last post was fixed in the 2.51 release but there is an additional error that crops up. If you are getting an error similiar to the follwing:
Notice: Undefined index: REQUEST_URI in F:\Domains\mydomain.com\wwwroot\wp-settings.php on line 81
To solve this issue you need to edit the wp-settings.php file. After line 79 or “// Append the query string if it exists and isn’t null” add the following line:
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],0);
This error is due to IIS not recognizing ‘REQUEST_URI’
If you don’t want to make the modification yourself you can download the modified wp-setting.php file from here.
WordPress 2.5 and IIS error and solution
After installing WordPress 2.5 I started getting a line of error text in every page of the admin area:
Notice: Undefined index: PATH_INFO in C:\WebSites\user\webroot\blog\wp-settings.php on line 72
Notice: Undefined index: PATH_INFO in C:\WebSites\user\webroot\blog\wp-settings.php on line 75
To solve this issue you need to edit the wp-settings.php file. Open the file in your favorite editor and after line 71 or “// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)” insert the following:
if ( isset($_SERVER['PATH_INFO']) ) {
add the closing “}” just above the original line 77 or “// Append the query string if it exists and isn’t null”
With those changes the problem is solved. I assume this problem will be fixed in the next release of WordPress.
Starter Kit Friendly Web Host
Google Map API - Adding address markers and geocoding
I had a need to add a set of markers to a Google map using the Google Maps API that could be easily modified over time. It is fairly easy to add markers with the Google Maps API but I wanted to put something together that will do the geocoding at the same time so I don’t have to manually add the lat / lng coordinates when I just want to add an address. As a result I put together the following bit of script. The addresses are loaded from an xml file named data.xml, geocoded and then added to the map. If you are going to use this example for yourself, just add your Google Maps API key and enter the addresses you want to add. You can visit a LIVE SAMPLE or download the full html page and associated data.xml file from HERE. If you would like to geocode a single address visit this site.
Read more


