Question: I have tried to create HtmlHelper for MVC 5 app in F# my implementation is following:

```
namespace FSharpStore.WebUI.HtmlHelpers

module PagingHelpers =
type HtmlHelper with
    static member PageLinks(info: PagingInfo, url : UrlHelper) : MvcHtmlString =
        let pageUrl x = url.Action("List", x.ToString())

        let sb = new StringBuilder()
        for i in 0..info.TotalPages do
            let tag = new TagBuilder("a") 
            tag.MergeAttribute("href", pageUrl(i))
            tag.InnerHtml <- i.ToString()
            if i = info.CurrentPage then
                tag.AddCssClass("selected")
                tag.AddCssClass("btn-primary")

            tag.AddCssClass("btn btn-default")
            sb.Append(tag.ToString()) |> ignore

        MvcHtmlString.Create(sb.ToString())

```

and I have tried used it in view accordingly:

`@using FSharpStore.WebUI.HtmlHelpers
<div class="btn-group pull-right">
 @Html.PageLinks(Model.PagingInfo, this.Url)
</div>`

Code is not compilable and it give me message :
'System.Web.Mvc.HtmlHelper' does not contain a definition for 'PageLinks' and no extension method 'PageLinks' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

Have anyone done HtmlHelper in F# successfully? I have tried used code extensions in difference part of project and they are just working. I think it's something special with razor itself.

Answer: 
Your problem is in your implementation of `Parcelable` -- particularly your `Parcel` constructor:

```
public Company(Parcel in) {
    in.writeInt(uid);
    in.writeString(name);
    ...
}

```

You're writing fields *to* the `Parcel` in your constructor. This is the point where you need to *read in* the data from the `Parcel` into the object you're creating. For example:

```
public Company(Parcel in) {
    uid = in.readInt();
    name = in.readString();
    ...
}

```
You can create a listener to communicate between your fragment and your activity :

```
public interface CompanyListener
{
    public void sendCompany(Company company);
}

```

Next, in your Fragment you have to create an instance of this listener 

```
private CompanyListener companyListener;

```

In the `OnAttach` you have to instantiate it and uninstantiate it in the `OnDetach`:

```
@Override
public void onAttach(Activity activity)
{
    super.onAttach(activity);
    this.companyListener = (YourActivity) activity;
}

@Override
public void onDetach()
{
    super.onDetach();
    this.companyListener = null;
}

```

Now you just have to implement it in your activity.

Also you can use [Otto library from Square](http://square.github.io/otto/) but it's more complicated :)