469,291 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,291 developers. It's quick & easy.

Problem Using HTML Controls in ASP.Net (with Designer)

I've run into a problem on a couple of projects that I think I've
identified - but would like confirmation of what I think is going on. Also
interested in any fast solutions to fix the user controls/pages that
resulted from this.

On these projects the page design was done with designers who used pure HTML
with an HTML editing tool outside of Visual Studio.

The developers then created the empty pages/user controls, copied the HTML
code into the ASP text, made some minor changes to make the pages/user
controls basically work, then went on their way. As long as the pages/user
controls weren't loaded into Designer, they seemed to function properly.
They built and ran as expected.

When these pages/user controls were opened for editing in Designer, though,
some of them behaved oddly. As soon as they were opened Visual Studio wanted
to check them out. It then made changes to the code, sometimes adding
controls that weren't wanted, sometimes other changes. A common example is
that some pages using user controls added a label definition (Label1) to the
page. Only the label declaration was added. It was never instantiated nor
used in any other way.

My suspicion is that when controls are added within the Designer or removed
that related additions and deletions are made to the associated resource
file. Since these controls were added only in the ASP code the Designer
didn't recognize that the resource files had to be updated as well - so the
code and resources were no longer in sync.

So, as long as the developer fixed the problems, built the project, and
checked the working version into SourceSafe, everything would appear to be
working properly. But the next time a developer reopened the item in the
Designer it found the resources didn't match the code and made an attempt
(adding the label) to try and fix the problem - anyway, that's my hunch.

1. Can anyone confirm to me that this is what's actually going on here?
2. If so, can you point me to an easy way to fix these files?
3. Does anyone know if the next version of Visual Studio will exhibit a
similar problem? ...Or will it be smart enough to fix it automatically?

Thank you.
Nov 19 '05 #1
1 1419
JV
I can't confirm anything about VS inner workings, but I have seen similar
problems. I think this is a case of "Karate do yes, or Karate do no,
Daniel-san". Use one development tool or the other but not both?

I do know that Visual studio is nearly always reformatting the HTML of a
page when you open it in the designer. Sometimes it does a good job, but
plenty of times it messes up your nicely formatted html (annoying if you did
it by hand). Maybe with XHTML it can do a better job, but I haven't had
time to check out 2.0.

It also does a number of other things. I am not sure exactly what it does
with the .res file, but it definitely does try to keep those things in
synch. At least for C# it may also generate class variables for the form if
you have any controls which have the ID field set and runat="server"
declared.

It probably does other arcane things of which I am not aware.

"E. Tom Jorgenson" <ET****@Hotmail.Com>
I've run into a problem on a couple of projects that I think I've
identified - but would like confirmation of what I think is going on. Also
interested in any fast solutions to fix the user controls/pages that
resulted from this.

On these projects the page design was done with designers who used pure
HTML with an HTML editing tool outside of Visual Studio.

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Marina | last post: by
1 post views Thread by Joe Bloggs | last post: by
reply views Thread by 42 | last post: by
5 posts views Thread by Marcel Gelijk | last post: by
1 post views Thread by Kris van der Mast | last post: by
3 posts views Thread by Ankit Aneja | last post: by
4 posts views Thread by Rod Gill | last post: by
4 posts views Thread by Goran Djuranovic | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.