Beta 2 inherits

S

sck10

Hello,

I was using the following for my codebehind with VW Developer Beta1:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.ImageButton
Imports System.Data
Imports System.Data.OLEDB
Imports System.Web.Mail
Partial Class default_aspx


When I created a new page, I got the following.
Partial Class default_aspx
Inherits System.Web.UI.Page

My question is how do I convert what I had in Beta 1 to the new format (Beta
2)?
 
B

Bruce Barker

the coding model has been changed. in asp.net 1.0, the aspx page inherited
from the code behind. this caused the following

1) the code behind had to declare the server controls
2) the code behind had to hookup the events
3) to share variables from the codebehind to the aspx page, they had to be
protected

the new model, is thru the partial code model, the code behind and the aspx
page are merged into one il file (but you may think of it as a source
merge).

so to convert code from 1.0 to 2.0

1) change the class def to be a partial
2) remove all those protected declares
3) remove all form designer 1.0 code
4) open the page in the new designer
5) fix any compatibility changes

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top