Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

User Controls

I'm hoping someone can point me in the right direction.

Microsoft Visual C# .NET Step by Step mentions (on p. 422 Chapter 23) that "If you modify the user control, applications that use it can be configured to pick up the modified version of the control automatically without even needing to recompile."

How would I configure an application to do this?

Charles Reich
Wednesday, December 17, 2003

Doesn't this 'just work'?

If you have a page (page.aspx) that references a control (control.ascx) and you make a change to the ascx, the page should reflect the changed user control the next time it's loaded.

Rick Childress
Wednesday, December 17, 2003

I use VB.NET, which I assume works the same as C#.  Your VS project file contains a path (“HintPath”) to the referenced component.  Every time you compile the parent project, VS will look in the referenced component path for a newer version.  If a newer version is found, it’s copied to the parent project’s bin directory.  The only time I’ve seen this function fail is if the referenced component in the bin directory is read-only.

Joe Paradise
Wednesday, December 17, 2003

VS is irrelevant.  You should just be able to drop the ascx next to the aspx.

Rick Childress
Wednesday, December 17, 2003

I can see how this will work for ASP.NET pages.

Most of the "Step by Step" book is about stand alone Windows apps.

I was wondering how it might work with Windows Forms that you've already distributed (ie: something in the order of Windows Update which goes to Microsoft's website and sees if you need any patches).

This whole idea is probably much more than I can foresee using in the near future though.

Charles Reich
Thursday, December 18, 2003

*  Recent Topics

*  Fog Creek Home