Loading data, Migrating post-back web controls to, Javascript web controls – Pitney Bowes MapXtreme User Manual

Page 99

Advertising
background image

Chapter 5: Web Applications, Controls, and Tools

Migrating Post-back Web Controls to JavaScript Web Controls

MapXtreme v7.1

99

Developer Guide

The id attribute that causes this validation error is not output by MapXtreme; it is an attribute that is
output by ASP.NET.

To resolve this validation error, you may need to replace the DOCTYPE tag on your .aspx page.
Specifically, if you update your DOCTYPE tag to an XHTML DOCTYPE tag, the resulting page will
validate, even with the id attribute shown above. (ASP.NET will wrap the offending tag in a DIV tag,
all of which will validate against the XHTML DOCTYPE.) As an example, you might use the same
DOCTYPE tag that is generated for you when you create a new Web Application from Visual
Studio's ASP.NET template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Migrating Post-back Web Controls to JavaScript Web Controls

The process of migrating your pre-v6.5 Web controls

1

to the MapXtreme Web controls in versions

6.6 and higher is not automatic. Every application and migration process is different and depends on
how tightly coupled the application is with the functionality and design of the older Web controls.

The recommended migration process is to take a phased approach. In some cases code
restructuring might have to be done. The following processes need to be considered while migrating
your Web controls:

Loading Data

Replacing Controls

State and Event Management

Loading Data

The only way to load data with MapXtreme Web controls is by using a preloaded workspace. The
MapControl points to the MapAlias in the workspace and tries to display the map, not load the map.
The preloaded workspace is specified in the Web.config file. See

What Should the Initial Map

Look Like?

.

In the case where the MapControl is used to display multiple map images, set up the data so that all
maps are in one location, and change the MapAlias of the MapControl to choose the maps.

1.

In MapXtreme releases prior to version 6.5, the web controls required a postback page that called
Page_Load and Page_Unload every time a tool was used. These controls have been replaced by more
efficient JavaScript-enabled partial-page update controls. We provide the postback controls for backward
compatibility, but they have been marked Obsolete. Information on these controls is contained in the
MapInfo.Web.UI.WebControls namespace. For the JavaScript controls API, see the MapInfo.WebControls
namespace.

Advertising