Can I Re-register and Debug codebehind registered javascript

Posted on 2008-11-12
Last Modified: 2012-05-05
I am working on an inherited application so the rational for what I am about to present is not always clear to even me...

In this app, in the page_load, the following code exists...
if (!ClientScript.IsClientScriptBlockRegistered("jsULMRightsObjects"))
            ClientScript.RegisterClientScriptInclude("jsULMRightsObjects", "RightsMgmt.js");            

My first question is, while the app is running through my dev server (locally), if I change the code in RightsMgmt.js and "Refresh" the page in the browser.  Will my updated code be re-registered?  The code does NOT sit within an IsPostback check.

My second question is can I debug this code in VS?  I have put break points in the RightsMgmt.js file but they not being hit due to "no symbols loaded".  

In the past I have been able to debug external js files but in those cases I've used a link tag in the aspx page.

Thanks in advance for any help...

Question by:Bruce
    LVL 1

    Author Comment

    Update:  I have tested in another application that I can indeed set a break point, and have it hit, in a RegisterClientScriptInclude javascript file.

    I have checked my IE for Disable Script Debugging and it is not set on.  

    I have also looked at the "Attach to Process" dialog and the instance of IE that I am wanting to debug is already "attached".

    Hope this helps refine my questions.
    LVL 1

    Accepted Solution

    Update: I think I have it.  My javascript was not "well-formed" shall we say.  I corrected a function definition and now I can set and htit a breakpoint in the file.

    Is this possible?  Or did I change something else unknowingly and now it works?

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now