<script type="text/javascript"> $(document).ready(function () { var nFirst = $('#<%= TextBox3.ClientID %>').val(); var nSecond = $('#<%= TextBox4.ClientID %>').val(); var bFirst = $('#<%= TextBox1.ClientID %>').val(); var bSecond = $('#<%= TextBox2.ClientID %>').val(); $("#map").googleMap(); $("#map").addWay( { start: [parseInt(nFirst),parseInt(nSecond)], // Postal address for the start marker (obligatory) end: [parseInt(bFirst),parseInt(bSecond)], // Postal Address or GPS coordinates for the end marker (obligatory) route : 'way', // Block's ID for the route display (optional) langage : 'english' // language of the route detail (optional) }); return false; });</script>