SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

<a href="javascript: {ddwrt:GenFireServerEvent('__redirect={../notes/NewForm.aspx?ContactID={$ItemId}}')}">Form Action</a>
share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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