[quoted text, click to view] Amit wrote:
> Hi,
> I'm using VS.NET 2003 to develop web apps using ASP.NET and C# and having this annoying problem. Everytime I open an aspx page in the designer it attempts to format it. And since I have the file in SourceSafe, it asks me to check it out. This is a minor annoyance because I just say cancel to it, but the biggest headache is that sometimes it automatically removes code. The type of code it most often removes is when binding event-handlers to events (in the InitializeComponent method). Moreover it doesn't do it all the time - one day out of the blue it decides to delete these links and then I'm left scratching my head trying to figure out why my app isn't working.
> The other type of code that it *always* removes is when I have a "runat='server'" attribute in a <head> or <body> tag.
>
> I know other people have been having this problem but I can't seem to find a solution. It most definitely looks like a bug and there should be a fix for it.
> Thanks
> amit
There is no solution to this reformatting, and to the dissappearing code
in InitializeComponent. This has been a bug for YEARS and I understand
its not fixed in the next version either -- it probably has its own
annoyances added as well. The dissapearing code bug improved in vs.net
2003 but its still there. Since it won't be fixed, you have to learn how
to live with it. I've actually learned how to get the formatter to work
for me a little. I never open aspx files in the designer without saving
my html first. If it gets mangled in the designer I close the file
without saving it, then opening the previous saved version. It has
become second nature. I try to only use the designer when I am lazy and
want to hook up some events. Turn off all automatic formatting in
options, this may help in some situations, but you can't turn it off
completely. Its a brain dead propellerhead bug by a bunch who think they
own your machine. Personally I think another company wrote the designer
editors, so microsoft can't fix it. I've been told this is wrong however.