ArcGIS Routing with NAServer
ArcGIS_NAServer_Routing_VBNet\MapImage.aspx.vb
' Copyright 2010 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See the use restrictions.
' 



Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Public Partial Class MapImage
  Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    ' Draw the Map image from the Session State
    Dim mapImage As System.Drawing.Image = TryCast(Session("MapImage"), System.Drawing.Image)
    If Not mapImage Is Nothing Then
      Response.ContentType = "image/jpeg"
      mapImage.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
    End If
  End Sub
End Class