I have SharePoint 2016 project in visual studio 2015. My project contains 5 visual web parts with LinkButtons. But click button event is not working for any of link button.

First I thought it is the issue of link button, but when I added normal button, click was not working for this too. I added new test web part but the same problem is there.

Even I thought may be the project has some issue. I added a new empty SharePoint 2016 project in solution and added a test webpart with containing only single button and nothing else. But click event is not still working.

When I tried to debug, Page load event is working fine but click event is not. Does anyone have idea about it?

  • Strange behavior, please make sure that the button click event is attached to the generated click method, by clicking right on the button, properties, then click on event and check the click event and its method. – Mohamed El-Qassas MVP Aug 22 '17 at 7:58
  • Try in chrome and see for any javascript error in console. Also check for 404 not found errors on js files – Ahmad Zia Aug 22 '17 at 8:14
  • Checked but no clue found yet. I just found that problem is not only for new projects but for all the previous projects in the solution which was working fine before, are now affected with the problem that no click event is firing for any of button or link button. – DevTex Aug 22 '17 at 8:15
  • Try to do a server restart,and test again. also create a new web appln. site collection,and associate your sample visual web part project with the site collection and press F5. Then let us know, any errors been thrown or whats the result. creation of visual web parts is not changed from SP 2010, SP 2013,SP 2016 . so you can have a check with any links in google, that gives you how to create/deploy a visual web part in ON-PREMISES soln of SharePoint. Run the Visual Studio as "Administrator" – userAZLogicApps Aug 22 '17 at 8:41
  • Web browser seems not an issue. Can you try with your login on your colleagues machine to isolate if it is a machine specific issue? – Ahmad Zia Aug 22 '17 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.