[mapguide-users] InitializeWebTier

Vishaal vs2k2000 at rediffmail.com
Thu Feb 28 02:02:28 EST 2008


Hi Swetha,

there should be no problem at all after the description given by Jackie.
neways, what you can do is make a new solution or say a new ASP.NEt website
and place the folder in http(at the time of creating the solution---open
visual studio , click on file--click on new website---select asp.net website
from the templates available---select the location as http from the location
list box below left on the screen---give path like
"http://localhost/yourwebsitename"......)this will create your solution
directly in the local host...once this is complete...open the default.aspx
page and write the following code:

<%@ Page Language="C#" %>
<%@ Import Namespace="OSGeo.MapGuide" %>

<%    
       
MapGuideApi.MgInitializeWebTier(@"C:\ProgramFiles\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini");
        MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
        MgSite site = new MgSite();
        site.Open(userInfo);

        String   sessionId = site.CreateSession();
        String  webLayout = "Library://......ur path";
    
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>your Title</title>
</head>

<frameset rows="0,*" border="0" framespacing="0">
  <frame />
  <frame src="/mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%= sessionId
%>&WEBLAYOUT=<%= webLayout %>" name="ViewerFrame" />
</frameset>

</html>  





hope this will solve your problem...you can always revert in case f any
problems faced...




swetha1 wrote:
> 
> Hi,
> 
> Well i am running the application with Visual Studio built in
> WebServer.....How do i change the WebServer??? And Regarding the folder
> have prepared it in the www folder.... So may be the webserver is creating
> the problem.... Can you please send me the code and help me out in how to
> change the WebServer.....I am new user to both Visual Studio and Mapguide
> OpenSource..... And have a submission in 2 days.... Please
> 
> Thanks for your help in advance
> 
> 
> 
> 
> Jackie Ng wrote:
>> 
>> InitializeWebTier() is defined in the utilityfunctions.aspx that you
>> omitted from inclusion.
>> 
>> The reason you are getting errors in are probably because of:
>> 
>> - You are using frames (evil, but unavoidable since that's how the AJAX
>> viewer was designed). Visual Studio has no designer support for
>> frames/framesets and can throw false errors, and most of the time these
>> are non-fatal validation errors becuase you are validating a frameset
>> document with a non-frameset doctype.
>> 
>> - You are probably running your asp.net application with Visual Studio's
>> built in webserver (Cassini), this will NOT WORK because it requires
>> access to the mapviewernet and mapagent directories that Cassini does not
>> and will not know about. You must configure your project to launch in
>> IIS.
>> 
>> - All the sample code is inline like classic asp, which goes against the
>> common asp.net code-behind model, making it hard to "copy and paste" to
>> your asp.net projects.
>> 
>> - The dotnetviewersample was done with the expectation that it is to be
>> deployed in the www folder of your MGOS installation (because it is
>> hardcoded to look for webconfig.ini in that folder). If you have copied
>> the dotnetviewersample, file-by-file, line-by-line it will probably fail
>> if it is not inside the www folder.
>> 
>> So my recommendation is:
>> 
>> - Put your code in a folder inside MapGuide's www directory.
>> - Put that include utilityfunctions.aspx line back in.
>> - Ignore any non-compliation errors Visual Studio throws at you.
>> 
>> Hope that helps.
>> 
>> - Jackie
>> 
>> 
>> swetha1 wrote:
>>> 
>>> Hi,
>>> 
>>> I am trying to open this dotnetviewersample in Visual studio, It is
>>> giving an error in the utilityfunction.aspx....so i created my own
>>> project where in i pasted the code from ajaxviewersample and deleted the
>>> line #include file="utilityfunctions.aspx"......and tried calling the
>>> weblayout in that file.... where it is giving the error in
>>> initializewebtier().....cant understand what to do and how to proceed
>>> with...
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/InitializeWebTier-tp15729918s16610p15730817.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list