Saturday 19 October 2013

Difference between GridView and DataList in Asp.Net.

GridView and DataList re data-bound control used to display and modify data from Asp.Net web form/appliaction.These control also conatin other asp.net control like label,textbox,checkbox,radio-
Button ,dropdown, image-control etc.These control are also bound with data source control like SqlDataSource,LinqDataSource to display data and to modify data in asp.net web form.

Difference Between GridView and DataList:-


        GridView
        DataList
1.It was introduced in Asp.Net 2.0.
1. It was introduced in Asp.Net 1.0.
2. It support built-in paging and sorting.
2. need to write custom code.
3. It support built-in update and delete operation.
3. need to write custom code.
4.It support auto format or style feature.
4. not supported.
5. RepeatDirection property not supported.
5. Arrange data item horizontly or vertically by using property RepeatDirection.
6.Does not support customisable row seperator.
6.Support customisable row seperator by SeperatorTemplate.
7. Performance is slow as compared to DataList.
7. Performance is faster than as compared to GridView.

Difference between GridView and Repeater in Asp.Net.

GridView and Repeater re data-bound control used to display and modify data from Asp.Net web form/appliaction.These control also conatin other asp.net control like label,textbox,checkbox,radio-

Button ,dropdown, image-control etc.These control are also bound with data source control like SqlDataSource,LinqDataSource to display data and to modify data in asp.net web form.

Difference Between GridView and Repeater:-

        GridView
        Repeater
1.It was introduced in Asp.Net 2.0.
1. It was introduced in Asp.Net 1.0.
2. It support built-in paging and sorting.
2. not supported.
3. Row selection supported.
3. not supported.
4.It support auto format or style feature.
4. not supported.
5. Editing of content is sipported.
5. not supported.
6. Performance is slow as compared to datagrid.
6. Performance is faster than as compared to all among data control.
7. Table render
7. Template render

Difference between DataList and Repeater in Asp.Net.

DataList and Repeater  re data-bound control used to display and modify data from Asp.Net web form/appliaction.These control also conatin other asp.net control like label,textbox,checkbox,radio-

Button ,dropdown, image-control etc.These control are also bound with data source control like SqlDataSource,LinqDataSource to display data and to modify data in asp.net web form.

Difference Between DataList and Repeater:-

     DataList
       Repeater
1.Template render
1. Table render
2.automatically generate data column.
2. not supported.
3.Row selection supported.
3. not supported.
4.Editing of row/column supported.
4. not supported.
5.Arrange data item horizontly or vertically by using property RepeatDirection.
5. not supported.
6. slower as compared to repeater.
6. faster as compared to Datalist.

Difference Between ListView and GridView in Asp.Net.

GridView and ListView are data-bound control used to display and modify data from Asp.Net web form/appliaction.These control also conatin other asp.net control like label,textbox,checkbox,radio-
Button ,dropdown, image-control etc.

Difference Between ListView and GridView :-


          ListView
          GridView
1.It was introduced in Asp.Net 3.5.
1. It was introduced in Asp.Net 2.0.
2. Table render.
2. Template render.
3. It support built-in data-grouping.
3. Need to write cutome code.
4.It support built-in insert operation.
4. Need to write cutome code.
5. Performance is slow as compared to datagrid.
5. Need to write cutome code.

Difference between GridView and DataGrid in Asp.Net.

GridView and DataGrid are data-bound control used to display and modify data from Asp.Net web form/appliaction.These control also conatin other asp.net control like label,textbox,checkbox,radio-
Button ,dropdown, image-control etc.

Difference Between GridView and DataGrid:-

         GridView
           DataGrid
1.It was introduced in Asp.Net 2.0.
1.It was introduced in Asp.Net1.0.
2. It support built-in paging and sorting.
2.It does not support built-in paging and sorting. For sorting you need to handle SortCommand and for paging you need to hanle PageIndexChanged command.
3.It support auto format or style feature.
3. This feature is not available in this.
4. Performance is slow as compared to datagrid.
4. Performance is fast as compared to GridView.

Tuesday 8 October 2013

How to calculate route between two points on google map.

In this article, I have explained how to calculate route on google map between two points. For this I have taken two text boxes and one button on the page. Enter the two points name or latitude and longitude values and click the button then it will show the path on map.

JS code for calculating Route:-

<script>
var directionsDisplay;
    var directionsService = new google.maps.DirectionsService();



    function InitializeMap() {
        directionsDisplay = new google.maps.DirectionsRenderer();

        var latlng = new google.maps.LatLng(12.917354, 77.622064);
        var myOptions =
            {
                zoom: 8,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
        var map = new google.maps.Map(document.getElementById("map"), myOptions);

        directionsDisplay.setMap(map);
        

    }

    function calcRoute() {


        var start = document.getElementById('startvalue').value;
      
      
        var end = document.getElementById('endvalue').value;
       

            var request = {
                origin: start,
                destination: end,
                travelMode: google.maps.DirectionsTravelMode.DRIVING
            };

       
           
            directionsService.route(request, function(response, status) {
                if (status == google.maps.DirectionsStatus.OK) {
                    directionsDisplay.setDirections(response);
                }
            });
        }


    function Button1_onclick() {
        calcRoute();
    }
</script>

Full coding with JS and Html:-
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>

var directionsDisplay;
    var directionsService = new google.maps.DirectionsService();



    function InitializeMap() {
        directionsDisplay = new google.maps.DirectionsRenderer();

        var latlng = new google.maps.LatLng(12.917354, 77.622064);
        var myOptions =
            {
                zoom: 8,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
        var map = new google.maps.Map(document.getElementById("map"), myOptions);

        directionsDisplay.setMap(map);
        

    }

    function calcRoute() {


        var start = document.getElementById('startvalue').value;
      
      
        var end = document.getElementById('endvalue').value;
       

            var request = {
                origin: start,
                destination: end,
                travelMode: google.maps.DirectionsTravelMode.DRIVING
            };

       
           
            directionsService.route(request, function(response, status) {
                if (status == google.maps.DirectionsStatus.OK) {
                    directionsDisplay.setDirections(response);
                }
            });
        }


    function Button1_onclick() {
        calcRoute();
    }
</script>

</head>
 <body   onload = "InitializeMap()">
<table id ="control">
<tr>
<td>
<table>
<tr>
<td>From:
   
</td>
<td>
    

    <input id="startvalue" type="text" style="width: 305px"  /></td>
</tr>
<tr>
<td>To:</td>
<td><input id="endvalue" type="text" style="width: 301px" /></td>
</tr>
<tr>
<td align ="right">
    <input id="Button1" type="button" value="GetDirections" onclick="return Button1_onclick()" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign ="top">
<div id ="map" style="height: 390px; width: 489px"></div>
</td>

</tr>
</table>
</body>
</html>