Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Record Navihation - How to handle missing list item id

  Asked By: Ariel    Date: Aug 19    Category: Sharepoint    Views: 4801

I am using SPD, and modified dispform.aspx and I have added 1
paramater as mentioned below

<ParameterBinding Name="ListItemId" Location="QueryString
(ID)" DefaultValue="0"/>

Then added following variables

<xsl:param name="ListItemId"/>
<xsl:variable name="RedirectLocNext">DispForm.aspx?ID=<xsl:value-of

<xsl:variable name="RedirectLocBack">DispForm.aspx?ID=<xsl:value-of
select="$ListItemId -1"/></xsl:variable>

Then I have added 2 buttons with following properties
<input name="Button1"
type="button" value="Back" onclick="javascript:
<input name="Button2"
type="button" value="Next" onclick="javascript:

Back and Next record navigation works perfect till if any listtem id
is missing in sequence like if you are navigating listitem from
77,78,80,81,82, now as listitem id 79 is missing it gives you error,
becoz this item either deleted or it is not there.

Can anyone tell me how do I handle this situtation?



2 Answers Found

Answer #1    Answered By: Joanne Greer     Answered On: Aug 19

I think you're going to have to load the list  (or part of the list) as a
datasource in the page, and test to see what's on either side; beyond that,
I'm not sure how much you'll be able to do with XPath.

Answer #2    Answered By: Cathy Cameron     Answered On: Aug 19

I did this in a sample asp.net page with EOF and BOF check, but I
want to implement simply in dispform.aspx using SPD.

Didn't find what you were looking for? Find more on Record Navihation - How to handle missing list item id Or get search suggestion and latest updates.