Control Declarations Disappear from ASP.NET 1.1 to ASP 2.0

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.
 
B

bruce barker \(sqlwork.com\)

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)
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top