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 have an event receiver(item adding,item added)..on a custom list..this event receiver creates an ID when a new item is created..so when i deactivate the event receiver and add a new item to the list it adds it with empty ticketID(since no event receiver, no ticket id is generated)... so is there any way where the newform.aspx before saving will know if the event receiver is activated or deactivated, so if its deactivated it wud not let to add new item and throw error.. any suggestions?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You can implement below logic:

You can have list 'read only' when feature\eventreceiver is de-activated or not installed. On activating, grant contribute rights to the list.

This way you ensure that items can only be created when feature\eventreceiver is active.

share|improve this answer
add comment

Just throwing an idea...

You may write write a web part, all it does is check if event receiver is attached to List in context (SPContext.Current.List.EventReceivers collection). If not, redirect to an error page about invalid list configuration. And drop the webpart on the page.

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.