Here is a small example of how to convert a System.Drawing.Color to the HTML color format (Hex value or HTML color name value) and back.
System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml("#F5F7F8");
String strHtmlColor = System.Drawing.ColorTranslator.ToHtml(c);
Update (11/7/2007): This control is now located here: http://codeplex.com/pietschsoftve3
I just uploaded a new release (v0.02) of my ASP.NET 2.0 Virtual Earth v3 Server Control. The download contains a Visual Studio 2005 solution that contains the source code for the server control dll and a sample website that uses the control. The only new feature in this release is full ViewState support. I do plan on adding many more features to this control as I get time to work on it. Enjoy!
One of the things I noticed is they are adding support for the XMLHttpRequest object if the browser doesn't natively support it. In the past I've traditionally just created a function named similarly to 'CreateXMLHttpRequestObject' and I make that function support multiple browsers. The technique that's used in Atlas is they are adding ... [More]
I need to geocode some addresses once in a while and I notice if you view the source of the Google Maps page, the geocodes are right there. So instead of looking at the source of the page manually, I just created a little app that scrapes them from the page for me and places them into textboxes.
Below is a small code snippet I wrote that does just that. It's not perfect but it is simple and it just plain works.
string lat = "";string lng = "";string address = "1 Microsoft Way, Redmond WA";
Here is v0.01 of my ASP.NET Virtual Earth v3 custom control. The zip file download contains the DLL code and a sample test website.
PietschSoft.VE3 v0.01 Features:
Display map on a page with server side parameters (latitude, longitude, zoom, map style, etc.)
Ability to plot points on the map from with in server side code
I am modeling the objects in my li... [More]
Add a .js file include inside the page header:
var str = '';
var elem = document.... [More]