S
Stan
I want to make two pages interact through a controller.
1. Page A has a grid and Add button.
2. When Add button is clicked Page B pops up.
3. User enters information and clicks Save
4. Information is saved in database
5. User goes back to Page A which gets new data from database and displays
one more row.
So, the event handler for Add button on Page A might look like:
private void btnAdd_Click(object sender, System.EventArgs e)
{
Server.Transfer (string.Format ("PageB.aspx?id={0}", id));
}
but I want PageA to instantiate a controller class, which would in turn
transfer to Page B, Page B would collected data from a user and again would
called the controller to save data and controller would transfer back to the
Page A.
My problem is that I don't know where to put the controller code.
I would like the controller to be an independent class. However, if I do
that, how does the controller get reference to the current http context and
object (to do Server.Transfer for example)?
Thanks,
-Stan
1. Page A has a grid and Add button.
2. When Add button is clicked Page B pops up.
3. User enters information and clicks Save
4. Information is saved in database
5. User goes back to Page A which gets new data from database and displays
one more row.
So, the event handler for Add button on Page A might look like:
private void btnAdd_Click(object sender, System.EventArgs e)
{
Server.Transfer (string.Format ("PageB.aspx?id={0}", id));
}
but I want PageA to instantiate a controller class, which would in turn
transfer to Page B, Page B would collected data from a user and again would
called the controller to save data and controller would transfer back to the
Page A.
My problem is that I don't know where to put the controller code.
I would like the controller to be an independent class. However, if I do
that, how does the controller get reference to the current http context and
object (to do Server.Transfer for example)?
Thanks,
-Stan