Question: I'm developing a hybrid mobile application and am trying to get HTML5 Geolocation working on iPhone IOS8, but am having no luck. Does anyone know any known problems? I've tried lots of examples but none are even prompting the user to allow geolocation. It works fine in browser, but as soon as upload to PhoneGap Build and install on my mobile it doesn't do anything. 

Some example code i've tried is:

```
 <!DOCTYPE html>
 <html>
 <body>

 <p>Click the button to get your coordinates.</p>

 <button onclick="getLocation()">Try It</button>

 <p id="demo"></p>

 <script>
 var x = document.getElementById("demo");

 function getLocation() {
     if (navigator.geolocation) {
         navigator.geolocation.getCurrentPosition(showPosition);
     } else { 
         x.innerHTML = "Geolocation is not supported by this browser.";
     }
 }

 function showPosition(position) {
     x.innerHTML = "Latitude: " + position.coords.latitude + 
     "<br>Longitude: " + position.coords.longitude; 
 }
 </script>

 </body>
 </html>

```

I would use the PhoneGap plugin but couldn't get that working.

Thanks.

Answer: 
Finally I found the combination of Generic Controller and **shared** view as the best way. In this case also there could be an authentication for each controller separately.

**Generic Controller :**

```
 public abstract class GenericController<T> : Controller
        where T : BaseInformation
    {  //Controller Implementation for Index, Create, Edit, Delete   }

```

**View** in Shared folder

```
@model BaseInformation
//Model Implementation 

```

**Final controller**

```
[Authorize(Roles = "Admin")]
      public class Base1Controller : GenericController<Base1>
        {
        }
[Authorize(Roles = "Helpdesk")]
        public class Base2Controller : GenericController<Base2>
        {
        }

```
One method that can work well when you have closely related groups of entities (or any other object for that matter) is to split them into composable interfaces, for example:

```
public interface IIdIdentity
{
    int Id { get; set; }
}

public interface INameIdentity
{
    int Name { get; set; }
}

public interface IYourGroup : IIdIdentity, INameIdentity
{

}

public class Exapmle1 : IYourGroup
{
    public int Id { get; set; }

    public int Name { get; set; }
}

```

Then your view can accept any entity of type `IYourGroup` providing your domain entity fulfills the interface.