protected void btnGetDirections_Click(object sender, EventArgs e) { // create our location array containing the two locations specified on the page List <object> locations = new List <object>(); locations.Add(txtStart.Text); locations.Add(txtEnd.Text); //Map1.GetDirections(locations); // Set some custom RouteOptions, these are optional to set RouteOptions routeOptions = new RouteOptions(); routeOptions.DistanceUnit = RouteDistanceUnit.Miles; routeOptions.DrawRoute = true; // Set the Route Mode if (ddlRouteMode.SelectedValue == "Driving") { routeOptions.RouteMode = RouteMode.Driving; } else { routeOptions.RouteMode = RouteMode.Walking; } // Semi-Transparent Red Color color = Color.Red; color.A = 0.7; routeOptions.RouteColor = color; routeOptions.RouteWeight = 4; //4 pixels // Tell the map to load the directions Map1.GetDirections(locations, routeOptions); // Display that the directions are loading lblDistance.Text = "Loading Directions..."; }