private void createJson()
    {
        InmueblesBLL bllinmuebles = new InmueblesBLL();
        dt = bllinmuebles.SelectAllInmueblesMapa();
        int count = 0;
        int position = 0;
        foreach (DataRow dtRow in dt.Rows)
        {
            if (dtRow["Latitud"].ToString() != "" && dtRow["Longitud"].ToString() != "")
            {
                count++;
            }
        }
        //count = 100;
        string json = "{\"count\":" + count + ",\"photos\":[";

        foreach (DataRow dtRow in dt.Rows)
        {
            if (dtRow["Latitud"].ToString() != "" && dtRow["Longitud"].ToString() != "")
            {
                position++;

                if (dtRow["Numero"].ToString() == "900")
                {

                }

                if (position < count)
                {

                    json += "{" +
                    "\"mark_id\":\""            + dtRow["IdInmueble"].ToString()            + "\"," +
                    "\"Inmueble_dir\":\""       + validateNull(dtRow["Calle"].ToString())                 + " "   + validateNull(dtRow["Numero"].ToString()) + "\"," +
                    "\"latitude\":"             + convert(dtRow["Latitud"].ToString())      + ","   +
                    "\"longitude\":"            + convert(dtRow["Longitud"].ToString())     + ","   +
                    "\"tipo\":\""               + dtRow["Tipo"].ToString()                  + "\"," +
                    "\"Piso\":\"" + validateNull(dtRow["Piso"].ToString()) + "\"," +
                    "\"Departamento\":\"" + validateNull(dtRow["Departamento"].ToString()) + "\"," +
                    "\"Operacion\":\"" + dtRow["Operacion"].ToString().Trim() + "\"," +
                    "\"nombreInmobiliaria\":\"" + dtRow["NombreInmobiliaria"].ToString()    + "\"},";
                }
                else
                { //if (position == count) {

                    json += "{" +
                    "\"mark_id\":\""            + dtRow["IdInmueble"].ToString()            + "\"," +
                    "\"Inmueble_dir\":\""       + dtRow["Calle"].ToString()                 + " "   + dtRow["Numero"].ToString() + "\"," +
                    "\"latitude\":"             + convert(dtRow["Latitud"].ToString())      + ","   +
                    "\"longitude\":"            + convert(dtRow["Longitud"].ToString())     + ","   +
                    "\"tipo\":\""               + dtRow["Tipo"].ToString()                  + "\"," +
                    "\"Piso\":\"" + validateNull(dtRow["Piso"].ToString()) + "\"," +
                    "\"Departamento\":\"" + validateNull(dtRow["Departamento"].ToString()) + "\"," +
                    "\"Operacion\":\"" + dtRow["Operacion"].ToString().Trim() + "\"," +
                    "\"nombreInmobiliaria\":\"" + dtRow["NombreInmobiliaria"].ToString()    + "\"}";
                   // }
                }

            }
        }

        json += "]}";
        Response.Clear();
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(json);
        Response.End();
    }