title: expected expression on javascript function
body: <p>I am using this function to display map using virtual map .  when i run this i get exception about the expression expected on <code>&lt;% if (b == 0) Then %&gt;</code> what i am doing wrong 
  Below is my javascript code 
  i declared <code>Dim b As Integer</code> </p>
  
  <p><code>&lt;script type="text/javascript" src="https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&amp;amp;s=1&amp;amp;mkt=en-us"&gt;&lt;/script&gt;</code></p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
           var myMap = null;
  
           function LoadMap()
           {
              myMap = new VEMap("mapDiv");
              myMap.LoadMap();
              myMap.SetZoomLevel(1);
  
  &lt;% If RS.HasRows Then %&gt;
  &lt;% if (b == 0) Then %&gt;
   StartGeocoding&lt;%=b %&gt;("&lt;%= rs("lot_address") &amp; " " &amp; rs ("lot_city") %&gt;, &lt;%= rs("lot_state") &amp; " " &amp; rs("lot_zip")%&gt;");
  &lt;% end if%&gt;
  function StartGeocoding&lt;%=b%&gt; ( address )
  {
     myMap.Find(null,    // what
                address, // where
                null,    // VEFindType (always VEFindType.Businesses)
                null,    // VEShapeLayer (base by default)
                null,    // start index for results (0 by default)
                null,    // max number of results (default is 10)
                null,    // show results? (default is true)
                null,    // create pushpin for what results? (ignored since what is null)
                null,    // use default disambiguation? (default is true)
  &lt;%if(b==0) Then %&gt;
                null,    // set best map view? (default is true)
  &lt;%else%&gt;
                false,    // set best map view? (default is true)
  &lt;%end if%&gt;
                GeocodeCallback&lt;%= b %&gt;);  // call back function
  }
  
  function GeocodeCallback&lt;% =b %&gt; (shapeLayer, findResults, places, moreResults, errorMsg)
  {
     // if there are no results, display any error message and return
     if(places == null)
     {
        alert( (errorMsg == null) ? "There were no results" : errorMsg );
        return;
     }
  
     var bestPlace = places[0];
  
     // Add pushpin to the *best* place
     var location = bestPlace.LatLong;
     var newShape = new VEShape(VEShapeType.Pushpin, location);
  
     var desc = "&lt;%=rs("lot_address")%&gt;&lt;br /&gt;&lt;%=rs("lot_city")%&gt;, &lt;%=rs("lot_state")&amp;" "&amp;rs("lot_zip")%&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='lot.asp?id=&lt;%=rs("id")%&gt;' class='link' style='color:black;'&gt;&lt;strong&gt;&amp;raquo; Get More Details &amp; Rates&lt;/strong&gt;&lt;/a&gt;";
     newShape.SetDescription(desc);
     newShape.SetTitle("&lt;%=rs("lot_name")%&gt;");
     myMap.HideInfoBox();
     myMap.AddShape(newShape);
     myMap.HideInfoBox();
     &lt;%rs.movenext
     if RS.HasRows Then 
     if (b==1) then%&gt;
      myMap.ZoomOut();
    &lt;%end if%&gt;
      StartGeocoding&lt;%=b+1%&gt;("&lt;%=rs("lot_address")&amp;" "&amp;rs("lot_city")%&gt;, &lt;%=rs("lot_state")&amp;" "&amp;rs("lot_zip")%&gt;");
     &lt;%else
     %&gt;
     myMap.ZoomOut();
     &lt;%end if
    // rs.moveprevious :
     %&gt;
     myMap.HideInfoBox();
  }
  
  &lt;%
  b=b+1
  
  rs.read
  loop
  rs.
  %&gt;
     myMap.HideInfoBox();
           }
  
           function UnloadMap()
           {
              if (myMap != null) {
                 myMap.Dispose();
              }
           }
      &lt;/script&gt;
  </code></pre>