I wish to add a custom button/link to each row in my list's AllItems.aspx page.

I've selected 'Modify in SharePoint Designed (Advanced)' from List Tools.

I've added a SharePoint From Action Hyperlink which appears for each item in the list:

<a href="javascript: {ddwrt:GenFireServerEvent('__redirect={../notes/NewForm.aspx?ContactID={@ID}}')}">Form Action</a>

I was hoping {@ID} would render as the ItemId in the list, however this is not the case.

How do I get the ItemId so I can pass it through to NewForm.aspx?

Many thanks.


Use {$ItemId} to include the Item Id in the url.

<a href="javascript: {ddwrt:GenFireServerEvent('__redirect={../notes/NewForm.aspx?ContactID={$ItemId}}')}">Form Action</a>
  • I tried that, but it just shows {ItemID} on the QS. It seems I can't use those variables while I'm already inside a { – Jamie Carruthers Aug 2 '11 at 8:44
  • Instead I have done the following <a href="../notes/NewForm.aspx?ContactID={$ItemID}">Form Action</a> – Jamie Carruthers Aug 2 '11 at 8:45
  • Updated the answer based on your findings. – Rich Ross Aug 2 '11 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.