G
Guest
Hi
I'm new to C#, moving from ASP, and slightly confused so bear with me!
Basically I've got 4 pages, each of which runs the same user control (some
header information). I want to be able to change the data in the user control
based on the page (everything else would be duplicated, hence the user
control).
Anyway, i thought the easiest way would be to use a variable set in the
Page_load event of the calling page. So I've got a variable defined in my
page class as..
public int pageID = 1;
However, when I try to access that from the user control, it says the
variable is not defined in the namespace. What am i missing!?!
Alternatively, I could use a URL object to get the page were on directly in
the usercontrol, but I couldnt find a URL method/property to give me just the
file name.
Hope all that makes sense!
Cheers
Dan
I'm new to C#, moving from ASP, and slightly confused so bear with me!
Basically I've got 4 pages, each of which runs the same user control (some
header information). I want to be able to change the data in the user control
based on the page (everything else would be duplicated, hence the user
control).
Anyway, i thought the easiest way would be to use a variable set in the
Page_load event of the calling page. So I've got a variable defined in my
page class as..
public int pageID = 1;
However, when I try to access that from the user control, it says the
variable is not defined in the namespace. What am i missing!?!
Alternatively, I could use a URL object to get the page were on directly in
the usercontrol, but I couldnt find a URL method/property to give me just the
file name.
Hope all that makes sense!
Cheers
Dan