My web site crashes and simply returns a bland page when I use the TagBuilder class in my controller.
The code works perfectly on my local machine, running Windows 7. I have tried with two different web hosts now, and they both have the same problem: A blank page if I use the TagBuilder class in code behind. I have made a workaround so that I simply build the tag string using String.Format, but I would of cause understand what the problem is, and then correct the error.
I feel like I should provide some code, but I have narrowed it down to the following line:
// A blank page is returned if unless I uncomment the following line
// and avoid the TagBuilder class.
TagBuilder tag = new TagBuilder("link");
I would really appreciate any help I can get with the following problem, because I just can not understand how this error can occur.
Where should I look? Web.config? I have tried enabling trace, but that didn’t help me. Has Microsoft changed anything recently in the TagBuilder class?
I never found out why my code did not work, but I did find a solution: I now precompile the website before I publish it to the website. I have absolute no idea why this works. 🙂