Solving a Problem
I want to follow up on the solution from the problem over the weekend. This is a production application. We were having a data type problem on the client and we honestly had no idea what was going on. There was more issue than I mentioned yesterday. I spent some time today on this application. I am incharge of the database, the web services, and the business logic while John is working on the UI. BTW, the UI code is not as simple as some people might think. Because I was able to step through the javascript, I was able to see what was going on and able to fix it. I shudder to think of how I would have fixed this under Visual Studio 2005 without a lot of document.write(.....) statements in the code. I am glad that I went through and upgraded the app on my development system.
Javascript Intellisense
It looks like I found something that can hang up the javascript intellisense. We are using the prototype.js library. I started noticing this type of error in the IDE.
Error 10 Error updating JScript IntelliSense: C:\SVN\HappyMappy\website\scripts\prototype.js: Object expected @ 31:4 C:\SVN\HappyMappy\website\coolscripts\blah.js 1 1 C:\...\website\
This would seem to indicate a problem in the prototype.js file which we are also using. Why this stops the javascript intellisense, I don't know. I googled looking for an answer, I found that other folks seem to have similar problems with the prototype.js file and javascript intellisense in previous betas of Visual Studio 2008.
Adding references in Javascript Intellisense
Ok, so I am sure that people know about the javascript intellisense feature now. You can add a reference through
/// <reference path="blah.js" />
You also can get a reference by having things setup in the ScriptManager. Also, you can do this:
/// <reference path="Page.aspx" />
This could be helpful if you are in a .js file that is added into a page and you want to reference something else on that page, such as a web service in the ScriptManager. And yes, i agree that it seems like a backwards way to do things..........
Javascript Breakpoints
I had the following line in some javascript code
var SelectedOffice = $get("<%=ActiveOffice.ClientID%>").value; // if this isn't exact, it is fairly close.
I was going through a debug session. I wanted to set a breakpoint on that line, but I couldn't. I scratched my head on this. What is so special about that line?!? I could set a breakpoint in the debug session in the dynamic page, but the source page, that didn't seem to work correctly. Well, it ends up that because of <% %> characters, no break points can be set on that line in the source view. You can do something like this:
var ClientId = "<%=ActiveOffice.ClientID%>";
var SelectedOffice = $get(ClientId).value; // a break point can be set on this line.
I'd like to thank Scott Guthrie for pointing this out to me.
Creating an ASP.NET 3.5 AJAX Project
Ok, I want to create an ASP.NET 3.5 AJAX Project in Visual Studio 2008. How do I do that? Its easy. AJAX is now integrated into the basic ASP.NET Project.