A
Alan Silver
Hello,
I have installed the 2.0 framework, and am looking at converting some of
my 1.1 pages to use partial classes. I don't (yet) have VS2005, so I'm
doing this by hand, but am having problems.
I have a simple page that I made in the beta2 version of VWD. The code
behind looks like...
using System;
using System.Web.UI;
public partial class _Default : Page {
protected void Page_Load(object sender, EventArgs e) {
// do stuff here
}
}
From this, I assumed that all I needed to do to my existing code-behind
files was to change the class definition to be partial, and remove the
large list of lines like...
protected Literal litTest;
// etc
from the class definition. I did this, but the compiler complained that
litTest did not exist in the current context. If I put back the above
line, it worked.
The code-behind file that VWD generated didn't have the lines in
declaring each control in the code-behind, and it worked fine. What do I
need to do to get my file to work like that? I looked in the folder
where the files live, and couldn't see any other file relating to this
page. I seem to remember that 2.0 uses a third file, which contains
extra info. Is that what I'm missing? I couldn't see one for the page
VWD created, and I could move this page to another site and it worked
fine.
Thanks for any help.
I have installed the 2.0 framework, and am looking at converting some of
my 1.1 pages to use partial classes. I don't (yet) have VS2005, so I'm
doing this by hand, but am having problems.
I have a simple page that I made in the beta2 version of VWD. The code
behind looks like...
using System;
using System.Web.UI;
public partial class _Default : Page {
protected void Page_Load(object sender, EventArgs e) {
// do stuff here
}
}
From this, I assumed that all I needed to do to my existing code-behind
files was to change the class definition to be partial, and remove the
large list of lines like...
protected Literal litTest;
// etc
from the class definition. I did this, but the compiler complained that
litTest did not exist in the current context. If I put back the above
line, it worked.
The code-behind file that VWD generated didn't have the lines in
declaring each control in the code-behind, and it worked fine. What do I
need to do to get my file to work like that? I looked in the folder
where the files live, and couldn't see any other file relating to this
page. I seem to remember that 2.0 uses a third file, which contains
extra info. Is that what I'm missing? I couldn't see one for the page
VWD created, and I could move this page to another site and it worked
fine.
Thanks for any help.