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

When a user tries to respond to a survey he has already responded to SharePoint will return HTTP 500 and the following text:

Server Error in '/' Application. 
--------------------------------------------------------------------------------
You are not allowed to respond again to this survey. 

Description: An unhandled exception occurred during the execution of the current web  request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: You are not allowed to respond again to this survey.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 

[COMException (0x81020039): You are not allowed to respond again to this survey.]
    Microsoft.SharePoint.Library.SPRequestInternalClass.IsVotingAllowed() +0
    Microsoft.SharePoint.Library.SPRequest.IsVotingAllowed() +174
[SPException: You are not allowed to respond again to this survey.]
    Microsoft.SharePoint.Library.SPRequest.IsVotingAllowed() +312
    Microsoft.SharePoint.WebPartPages.ListFormWebPart.OnInit(EventArgs e) +955
    System.Web.UI.Control.InitRecursive(Control namingContainer) +143
    System.Web.UI.Control.AddedControl(Control control, Int32 index) +271
    System.Web.UI.WebControls.WebParts.WebPartManagerControlCollection.AddWebPartHelper(WebPart webPart) +305
    System.Web.UI.WebControls.WebParts.WebPartManagerControlCollection.AddWebPart(WebPart webPart) +1930590
    System.Web.UI.WebControls.WebParts.WebPartManagerInternals.AddWebPart(WebPart webPart) +63
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.AddWebPartWithRetry(WebPart webPart) +147
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.AddDynamicWebPart(WebPart webPart) +122
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts) +12053
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.LoadWebParts() +93
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) +690
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Page.OnInitComplete(EventArgs e) +11038910
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1674

which is kind of scary for users - they see the "server error" caption and think "WHOA THE SHAREPOINT FELL APART !!!!ELEVENELEVEN".

I've seen this question and I don't feel it covers the same situation - in the case I describe an ugly error message is returned and I wouldn't call getting rid of it customization.

Is there a way to make Sharepoint return some nice looking page instead saying something like "Sorry, you've already responded to this survey"?

share|improve this question
    
Have you tried changing customerrors="on" and callstack="false" in web.config? –  Daniel Ziga Jun 1 '12 at 11:34
add comment

3 Answers 3

Truly speaking it is not customizable.

I was also facing the same issue.

So I tried a workaround.

I showed my survey list through ECMA Script model.

And when it called the method ONFail, there I used my own customised message as a pop-up box

Hope this helps.

--NJoy

share|improve this answer
    
Agree with you. You could also use jQuery and SPServices. Sure, it's going to take some work, but at least you'll be able to reuse it in future surveys. –  tarjeieo Nov 1 '12 at 7:18
add comment

Do you have customerrors set to off and callstack set to true? If so, set customerrors to on and callstack to false and you will get the SharePoint error page which is a lot friendlier than they yellow screen of death.

share|improve this answer
    
Will that page explain specifically what went wrong or will it just say "Internal Server Error" as IIS HTTP 500 page typically does? –  sharptooth Jun 1 '12 at 11:51
    
Depends on the type of error thrown. If you throw a Microsoft.SharePoint.SPException then it will display the message. Otherwise, it displays, an unknown error has occurred. –  Steve Lineberry Jun 1 '12 at 12:26
    
Well, in this case it's System.Runtime.InteropServices.COMException. –  sharptooth Jun 1 '12 at 13:21
    
Actually, that comexception is rethrown as a SPException, if you look further down your trace. –  Steve Lineberry Jun 1 '12 at 14:58
add comment

You could create a infopath form. With that you would create 3 views (one view for filling out the survey form, other view when they click submit, like a thankyou page "Thank you for taking the survey" and 3rd view alreadytaken). If the user already did the survey then you would display "You have already taken the survey.". Hope it makes sense.

share|improve this answer
add comment

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.