Return 404 if no record is found

Pascal Adriaansen asked on July 30, 2015 15:46

Hi,

I'm using a universal page viewer to view some content based on a wildcard in the URL. The universal page viewer webpart has a setting to hide the webpart or show a text if no record is found. However, I would like the page to 404 when no record is found. Is this possible?

Kind regards,

Pascal

Recent Answers


Laura Frese answered on August 12, 2015 20:56

You could edit the web part to throw an HttpException if no records are returned. I'd recommend cloning the Uni page viewer and editing the clone so that it is not overwritten when you upgrade.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.