How to hook into url parameter generation (opposite of IModelBinder)?

Last post 10-16-2008 8:04 AM by lanwin. 0 replies.

Sort Posts:

  • How to hook into url parameter generation (opposite of IModelBinder)?

    10-16-2008, 8:04 AM
    • Member
      point Member
    • lanwin
    • Member since 10-16-2008, 6:46 AM
    • Posts 3

    Hi, is there any way of hooking into the url generation? What i search for is something like the opposite of the IModelBinder interface. Let me explain it in an example.

    Sometimes i need to encrypt parameters like an id. I can do this when i pass the encrypted data as string into the action method, but that is really uncomfortable. So i want to let ASP MVC doing it for me.

    For incoming request i can do this when i create a model binder like this:

    public ActionResult DoSomething( [Encrypt] int id )

    But i haven't found any way to dong in when i create an url with the ActionLink helper like this.

    <%=Html.ActionLink<FooController>(c=>c.DoSomething(12345),"Foo")%>

    Any idea? If there is no way a i create an feature request for it.

    Steve

Page 1 of 1 (1 items)