Which EncodeFor on data- attributes with URLs

I am trying put a URL into a data- attribute. In particular

<tr data-href="/page.cfm?Id=#EncodeForHTMLAttribute(ID)#">
   ...

OR perhaps it should be

<tr data-href="/page.cfm?Id=#EncodeForURL(ID)#">
   ...

Note that ID can have special characters

Edit:

Much later I am going to

$("tr").click(function() { window.location = $(this).data("href"); });