0

I am developing a web part for SharePoint in Visual Studio. This web part displays record from database. There is some line of code containing jquery/javascript code. I commented it, and now records have stopped displaying. I undid this action so now code was like previously but still report is not showing now.

I have tried restarting servers, database, IIS but no luck. Also used different browsers and cleared cache several times. So basically report doesn't show even though I simply commented 4, 5 lines code, then uncommented it. That's it.

No error, exception is being shown. Has anyone encountered something like this? What do I do in this case?

EDIT
By the way this happened twice on two different SharePoint farms. Same code, just commented some lines, then compiled code, report not shown, then I uncommented those lines, recompiled code, no error but report is not shown.

Frank Martin
  • 3,147
  • 16
  • 52
  • 73
  • 1
    Really tempted to answer just the question title with "yes". :) – Almo Mar 06 '14 at 14:03
  • I have done IIS reset several times. The file in which I commented code is a .js file. – Frank Martin Mar 06 '14 at 14:09
  • Yeah I saw that after rereading. Sorry. Just for giggles, in your JS file reference which I imagine is in your web part, add a "?ver=1" query string parameter to it. – SpartanDonut Mar 06 '14 at 14:11
  • Also, since this is JavaScript we are talking about, double check that the source code for the JS file is being updated as you make changes via the browsers developer tools to absolutely confirm the code isn't cached. – SpartanDonut Mar 06 '14 at 14:15
  • Yes I saw the js code in browser and it is there. – Frank Martin Mar 06 '14 at 14:21
  • Then I recommend hooking up the debugger and figuring out why its not working. If your web part is deployed properly and something isn't working it's more than likely a problem with the code and not the tools you are using. It's possible that it worked before because it was previously cached or something though we can't be certain. I would go through and make sure all the files exist in the hive as you expect and are of the right version, all your features are activated, all your assemblies are in the right locations, web config file has had appropriate additions added, etc. – SpartanDonut Mar 06 '14 at 14:26
  • I changed the name of js file to something else but still same issue. How do I debug this because this is javascript code and when I set breakpoint, it doesn't work? – Frank Martin Mar 06 '14 at 14:29
  • http://stackoverflow.com/questions/10191099/debugging-javascript-in-ie - Make sure you hit the start debugging button otherwise breakpoints won't be hit. If they still aren't getting hit it sounds like your code isn't actually getting called from anything which is definitely a problem and would be an explanation as to why changing the comments around has no effect. Easy test for that is pop an alert as the first line in the function and see if you get a message. – SpartanDonut Mar 06 '14 at 14:32

1 Answers1

0

Turns out it's not a bug but silly mistake by me. Fixed!

Frank Martin
  • 3,147
  • 16
  • 52
  • 73