[mapguide-users] Edit WebLayout Problem
SriRam007
binod_tripathy at yahoo.co.in
Thu Apr 8 02:46:04 EDT 2010
Hi everyone,
I m trying to edit the WebLayout using C#.net and i m using ajax viewer with
basic layout (SheboyganAsp)
here is my code for making tool bar invisible
public String MapName = "Sheboygan";
public String WebLayoutName =
"Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout";
protected void btn_Click(object sender, EventArgs e)
{
Utility.InitializeWebTier(Request);
MgUserInformation userInfo = new
MgUserInformation(Session["ID"].ToString());
MgSiteConnection siteConnection = new MgSiteConnection();
siteConnection.Open(userInfo);
MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;
MgMap map = new MgMap();
map.Open(resourceService, MapName);
MgResourceIdentifier WebLayoutId = new
MgResourceIdentifier(WebLayoutName);
MgByteReader byteReader =
resourceService.GetResourceContent(WebLayoutId);
XmlDocument doc = new XmlDocument();
string xmlLayoutDef = byteReader.ToString();
doc.LoadXml(xmlLayoutDef);
string MapDefinitionStr = ReplaceTextNodeValue(xmlLayoutDef,
"false");//Here i m finding the tool bar node and then visible node and
replacing the value true to false Error showing "Unauthorised Acces"//
resourceService.SetResource(WebLayoutId, new
MgByteReader(MapDefinitionStr, "text/xml"), null);
}
where is the problem can any one help me
thanks
--
View this message in context: http://n2.nabble.com/Edit-WebLayout-Problem-tp4869464p4869464.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list