SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an event receiver(item adding,item added)..on a custom list..this event receiver creates an ID when a new item is 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
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

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

Your Answer


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.