title: C#,HTML how can i populate html text box with values saved in session or values handled at server side?
body: <p>I have some textbox values in aspx page,which i pass on to the next page using sessions,but now i want to populate these values in a html textbox .How can i do it?The values that i have are server side ,where as HTML text box value is client side(this is just my assumption,i can be totally wrong on this part).</p>
  
  <p>The reason why i want to do this is i got code from the internet which gives location,map between two points,the directions between the source and destination,but it is using html textbox and i think it is using ajax (i have 0 knowledge of ajax) so if i replace html textbox with asp.net text box .I dont get the auto address completion feature .</p>
  
  <p>the aspx page is ,i am not able to understand the java script here cause it is very complex for me:</p>
  
  <pre><code> &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      var source, destination;
      var directionsDisplay;
      var directionsService = new google.maps.DirectionsService();
      google.maps.event.addDomListener(window, 'load', function () {
          new google.maps.places.SearchBox(document.getElementById('txtSource'));
          new google.maps.places.SearchBox(document.getElementById('txtDestination'));
          directionsDisplay = new google.maps.DirectionsRenderer({ 'draggable': true });
      });
  
      function GetRoute() {
          var mumbai = new google.maps.LatLng(27.4667, 89.6417);
          var mapOptions = {
              zoom: 7,
              center: mumbai
          };
          map = new google.maps.Map(document.getElementById('dvMap'), mapOptions);
          directionsDisplay.setMap(map);
          directionsDisplay.setPanel(document.getElementById('dvPanel'));
  
          //*********DIRECTIONS AND ROUTE**********************//
          source = document.getElementById("txtSource").value;
          destination = document.getElementById("txtDestination").value;
  
          var request = {
              origin: source,
              destination: destination,
              travelMode: google.maps.TravelMode.DRIVING
          };
          directionsService.route(request, function (response, status) {
              if (status == google.maps.DirectionsStatus.OK) {
                  directionsDisplay.setDirections(response);
              }
          });
  
          //*********DISTANCE AND DURATION**********************//
          var service = new google.maps.DistanceMatrixService();
          service.getDistanceMatrix({
              origins: [source],
              destinations: [destination],
              travelMode: google.maps.TravelMode.DRIVING,
              unitSystem: google.maps.UnitSystem.METRIC,
              avoidHighways: false,
              avoidTolls: false
          }, function (response, status) {
              if (status == google.maps.DistanceMatrixStatus.OK &amp;&amp; response.rows[0].elements[0].status != "ZERO_RESULTS") {
                  var distance = response.rows[0].elements[0].distance.text;
                  var duration = response.rows[0].elements[0].duration.text;
                  var dvDistance = document.getElementById("dvDistance");
                  dvDistance.innerHTML = "";
                  dvDistance.innerHTML += "Distance: " + distance + "&lt;br /&gt;";
                  dvDistance.innerHTML += "Duration:" + duration;
  
              } else {
                  alert("Unable to find the distance via road.");
              }
          });
      }
  &lt;/script&gt;
  
            &lt;input type="text" id="txtSource"  style="width: 315px" /&gt; 
             &amp;nbsp;&amp;nbsp; &lt;span class="auto-style4"&gt;Destination:&amp;nbsp;&lt;/span&gt;&amp;nbsp;
          &lt;input type="text" id="txtDestination" style="width: 318px" /&gt;
          &lt;br /&gt;
          &amp;nbsp;&lt;br /&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
          &lt;input type="button" value="Get Route" onclick="GetRoute()" style="margin-left: 437px" /&gt;
  </code></pre>
  
  <p>Can anyone please help me out with this .</p>