tags:

views:

56

answers:

1

I have Ajax.ActionLink with htmlAttribute param

<%= Ajax.ActionLink("cool", "ViewCategory", new { id = elem.ID }, new AjaxOptions { UpdateTargetId = "score_" + elem.ID.ToString() }, new { myAttr = 123 } )%>

How can I read this attribute in controller method?

A: 

You can't.

All the htmlAttribute param does is instruct the generation of additional attributes to be added to the anchor html with it is sent to the client. These attributes are not included in the request when the anchor is clicked.

Place the attribute along side the id new {id = elem.ID, UpdateTargetID = ...} this should be included in the URL.

AnthonyWJones