Control Declarations Disappear from ASP.NET 1.1 to ASP 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've just begun converting some websites from ASP.NET 1.1 to ASP.NET 2.0.
I'm consistently losing web control declarations when converting aspx pages.

All declarations like this disappear and I need to re-type them manually...
Protected WithEvents hrFile As System.Web.UI.HtmlControls.HtmlAnchor

This occurs when I use the conversion wizard, and when I manually copy/paste
an aspx file into a 2.0 project.

Is this common? Is there a way to retain these declarations when converting?

Thanks.
 
they disappear because they are not needed.

in 1.0 the aspx class inherited from the codebehind, so for both the
codebehind and asp code to see the same control, if had to be defined tin
the base class.

in 2.0 the code behind and the aspx code are partial classes (no
inheritance) so a control defined in aspx is defined in the code behind by
definition. you can also create server routines in script blocks in the aspx
page, and call then from the codebehind.

-- bruce (sqlwork.com)
 
Back
Top