VisualStudio corrupts ASPX page when opened in Designer

K

kingflux

Hello-- When I open an existing file (NoodlePage.aspx), VisualStudio
immediately changes around some lines, removes a few characters, and
switches some tags. I used fc.exe to compare the before and after;
even if I manually change each one back to the original, I get an
'Object reference not set to an instance of an object' error upon
viewing the page.

I can put back the original ASPX file and the original RESX file, and
the page works fine.

I applyied Visual Studio SP1 yesterday, but it did not fix this.

Any suggestions?
 
E

Eric

This is probably because you have some invalid html. If Visual Studio
doesn't understand the html, I've seen it try to fix things. Try
opening the original page, viewing the page source, and make sure you
address any warnings that Visual Studio gives you.
 
K

kingflux

Thank you for writing, Eric. There are no warnings in the Designer or
in the build process.

It's changing things like:

<tr height="5px"> to <tr height="5">

and switched my top four lines out of order. I suspect that it is also
corrupting the associated RESX file.
 
M

Mark Fitzpatrick

It's doing it correctly because <tr height="5px"> is an illegal HTML
statement, hence the translation into the other form. The only time you can
put pixel definitions for width is when you are using CSS. The following way
would be legal: <tr style="height:5px">
 
K

kingflux

And yet it works fine if I never open the file in VisualStudio. ???

I'm extremely confused. I can handle the 5px --> 5 conversion, but why
does it corrupt the file(s) to the point where I get an error during
runtime but not during build?
 
K

kingflux

Finally figured this out on my own. VisualStudio was adding
declarations to the code behind this ASPX page (NoodlePage.aspx.vb) and
not telling me!

The declarations exist correctly in the base/inherited page
(NoodleBase.vb), so these new declarations were conflicting. I can
delete the inserted declarations, save the file, and debug without the
fatal error.


(Microsoft products are helpful -- until you really need them to be.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top