I am pretty sure that any web developer would hate an exception that is hard to catch. One of those is the one which says “The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).”
In my case I got this exception on a page that was working perfectly about two days ago and now had been untouched since then. My first line of Googling defense resulted in articles like this article and other discussions that tell you to change the <%= xxxxx %> to <%# xxxxx %>. Below I show how my code was when I was getting the error.
However just changing the <%= sign to <%# or moving the script tag within the content placeholder did not make any difference because even though it removed the original issue but caused another problem. The JavaScript wouldn’t load. :S
Here is my solution that resolves the issue and still lets the JavaScript load.
Just inject the script tag in a literal in the head of the master page in the code behind.
The sample below shows how to convert time from one time zone (say local) to another time zone (say Arizona time)
DateTime dlocal = DateTime.Now;
DateTime dNonLocal
= TimeZoneInfo.ConvertTime(
dlocal,
TimeZoneInfo.FindSystemTimeZoneById("US Mountain Standard Time"));
Another real-good article on TimeZoneInfo class can be found here.
Recently when I was using LINQ to SQL (which I happen to love so much) and using the LINQ to SQL debug visualizer tool (which can be found here) to see what query was getting generated I came across an issue. below is a screen-shot of the query I was looking at.

If I inspected it in the quick-watch window, everything was fine. I get one member in my results collection.
However, when I look it up in the LINQ to SQL debug visualizer window, the SQL statement that is shown is not right. I see that the string parameter in that statement has not been enclosed in quotes. And hence when I click the execute button I get an exception.
So it goes to show that there is an issue in the visualizer even though the actual query seems to run perfectly fine.
I also saw a post regarding this behavior on the LINQ Project Forum and my advice to the people who have had this issue to keep the above issue in mind while debugging.
I got this error when I was trying to configure Subversion with Apache on Windows XP. There seem to be many people on Google who have this issue. This is my first time when I am installing these together so something that I noted might be trivial but at the same time I believe that it’s really easy to miss. Since I am mostly developing on IIS I need that to run on the default ports and hence have Apache running on a different ports. The point is not to forget to use the port (on which Apache is running) in the URL used while referring to the Subversion.
Make sure that you put permissions for the user you are logging in with, in the permissions file (the AuthSVNAccessFile). Make sure this user has permissions for the repository you are trying to checkout.
For example, to grant Harry read+write privilages to the repository called “MyRepositoryName”, the file should look like below.
[MyRepositoryName:/]
Harry = rw
More Posts