Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.