The Source:
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" Runat="Server">
<ajaxToolkit:TabContainer runat="server" ID="Tabs" OnClientActiveTabChanged="GetMap" ActiveTabIndex="1" CssClass="tab">
<ajaxToolkit:TabPanel runat="Server" ID="TabPanelMap" HeaderText="Tab Map">
<ContentTemplate>
<div id='MyMap' visible="false" style="position:relative; width:798px; height:400px; border:1px solid #7F9DB9;"></div>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel runat="Server" ID="TabPanel1" HeaderText="Tab 1">
<ContentTemplate>
<h2 style="font-size:1.4em;color:#353535;padding:20px 0;"> The first tab...</h2>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</asp:Content>
The Codebehind:
public partial class TestMap : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// local varible for dataset
int projectID = 172;
//Get DataSet
DataSet dsMap = ChainDA.MOCList(projectID);
// Add JS attribute to body tag... as we're using a master page
HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("MMCBody");
body.Attributes.Add("onload", "GetMap();");
// Add VE link to Head section
HtmlGenericControl msLink = new HtmlGenericControl("script");
msLink.Attributes.Add("type", "text/javascript");
msLink.Attributes.Add("src", "http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2");
this.Page.Header.Controls.Add(msLink);
// Produce JS text from DataSet
List<DotClass> point = new List<DotClass>();
foreach (DataRow theRow in dsMap.Tables[0].Rows)
{
int photoID = ImagesDA.GetImageForMap(projectID);
point.Add(new DotClass(Convert.ToString(theRow["Latitude"]), Convert.ToString(theRow["Longitude"]), Convert.ToInt32(point.Count), Convert.ToString(theRow["StreetName"]), Convert.ToString(theRow["City"]), photoID));
}
int count = Convert.ToInt32(point.Count);
string js = VirtualEarth.ResultsMap(point.ToArray(), count);
Literal clientScript = new Literal();
clientScript.Text = js;
this.Page.Header.Controls.Add(clientScript);
}
}
The codebehind is very specific to the app and may not be much help....