I do so:<br><br><font size="1"><span style="font-family: courier new,monospace;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</a>"></span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><script runat="server"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> protected string SessionId { get; set; }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> protected string WebLayout { get; set; }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> protected void Page_Load(object sender, EventArgs e)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> <span style="color: rgb(0, 102, 0);">//I do this only once in Application_Start:<br> // MapGuideApi.MgInitializeWebTier(@"C:\ProgramFiles\Autodesk\MapGuideEnterprise2010\WebServerExtensions\www\webconfig.ini");<br>
//...but if you're unsure, do it here...<br><br style="font-family: courier new,monospace;"></span></span><span style="font-family: courier new,monospace;"> MgUserInformation userInfo = new MgUserInformation("Anonymous", "");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> MgSite site = new MgSite();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> site.Open(userInfo);</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> SessionId = site.CreateSession();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> WebLayout = "Library://Samples/Layouts/DotNetSamples.WebLayout";</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></script></span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><head id="Head1" runat="server"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <title></title></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></head></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><frameset rows="0,*" border="0" framespacing="0"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> <frame /></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <frame src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%= SessionId %>&WEBLAYOUT=<%= WebLayout %>" name="ViewerFrame" /></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></frameset></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></html></span></font><br><br>Pietro Ianniello<br>
<br><br>