C
Celine
I have a set of similar classes (c1, c2, ...).
I would like to create a template (or a page with as much abstraction
as possible) to copy/paste, and create ASPX pages to edit
(add/update/...) these classes.
A customised page for each class, beacause there are few differences
between them
On top of this (copied) template, I would define the name of the class
I want to edit.
The following generates error, but you get the idea:
public class TemplateEdit : System.Web.UI.Page
{
protected Class1 mainObject; //replace Class1 by the Object to edit
protected string mainObjectName;
protected Type mainObjectType;
//Define main object here
mainObjectName = "Company";
mainObjectType = typeof(Class1);
//Generic code, the same on all aspx pages
this.mainObject = (mainObjectType) new Object();
this.mainObject = (mainObjectType)Session[mainObjectName];
Session[mainObjectName] = this.mainObject;
private void SubmitBtn_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
//....
}
I would like to create a template (or a page with as much abstraction
as possible) to copy/paste, and create ASPX pages to edit
(add/update/...) these classes.
A customised page for each class, beacause there are few differences
between them
On top of this (copied) template, I would define the name of the class
I want to edit.
The following generates error, but you get the idea:
public class TemplateEdit : System.Web.UI.Page
{
protected Class1 mainObject; //replace Class1 by the Object to edit
protected string mainObjectName;
protected Type mainObjectType;
//Define main object here
mainObjectName = "Company";
mainObjectType = typeof(Class1);
//Generic code, the same on all aspx pages
this.mainObject = (mainObjectType) new Object();
this.mainObject = (mainObjectType)Session[mainObjectName];
Session[mainObjectName] = this.mainObject;
private void SubmitBtn_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{
//....
}