views:

82

answers:

1

Hello

I've noticed that when developing an user control in vs2008, that I have to build the user control each time I want to see the changes that I've made. Changes that usually doesnt requiere that I build the project aren't visible until I compile and build the project. This mean that it take a lot more time to develop since the site takes time to start up.

I've noticed that if the same kind of changes are made in a .aspx page, that I dont need to build the project to see the differences.

Why does this occur and is there any kind of workaround this besides putting all the code in the pages insted of the user control?

Best regards, Daniel

A: 

Basically this occurs if the changes you are making are to code which is compiled at build-time rather than run-time. If you are working on a web application all server side code is compiled at build time while all inline aspx code is compiled at runtime.

During development of web software this is generally a good thing as any build errors are highlighted before the application is deployed and compilation doesn't have to happen on the server at first load.

A possible workaround is to develop your control in a "Web Site" rather than a "Web Application" as this compiles each page and control seperatley at runtime rather than compiling the whole application into one dll at build time.

This article explains the difference between the "Web application project" and "Web site" models quite briefly

Sheff
what do you mean by "all frontend code is compiled at runtime"? Isn't all asp.net code that is compiled, server-side?
Ciwee
Ah, that sounds reasonable. But I still dont get why the aspx don't need to be recompiled to see the differences in the markup
Daniel
@André Pena Sorry I mean to say inline code on aspx pages rather than frontend code, that was a bit confusing, sorry, I have edited accordingly
Sheff
Ok, too bad that my project as to many references, otherwise it would make sense to develop them in a website.
Daniel
@Daniel with regards to editing the markup on a aspx page (or ascx control), you are right you should not(in in fact, do not) have to recompile to see your changes. Its the control simply registering it on aspx page or adding it to the pages controls collection in the code behind?
Sheff
Well, I do have to recompile the project if I would like for example add an css style on the markup(not code behind). This only occurred in the forms(aspx) and not the user controls(ascx)The controls are not registrered in code behind
Daniel