M
Mark Harris
I have an interesting situation that i could not find a resolution for on
google or msdn, it goes as follows:
The web app i have has about 35 pages, each requires the same code in the
page_load (about 62 lines). If i need to change a single part of that
code, is there a way to do it without find/replace over the whole project.
As the code i wish to change (and other sections i may wish to change in
the future) is also in some other parts of the project. Such as below:
if (helper.GetServiceRunning((string)Session["__SelectedService"]))
{
txtStartStop.Text = "Stop";
divRestartServer.Visible = true;
}
else
{
txtStartStop.Text = "Start";
divRestartServer.Visible = false;
}
I need to add a parameter to helper.GetServiceRunning, i was thinking it
would be mighty handy if i could just put this code in a .cs file and
include it at the right point on every page, then any changes/additions
would be dead easy later on.
I'm using Visual Studio .Net 2003 if it will pre-process anything to do
this.
Any ideas/insights would be very good
Its pretty frustrating when you need to go and change something =\
- Mark
google or msdn, it goes as follows:
The web app i have has about 35 pages, each requires the same code in the
page_load (about 62 lines). If i need to change a single part of that
code, is there a way to do it without find/replace over the whole project.
As the code i wish to change (and other sections i may wish to change in
the future) is also in some other parts of the project. Such as below:
if (helper.GetServiceRunning((string)Session["__SelectedService"]))
{
txtStartStop.Text = "Stop";
divRestartServer.Visible = true;
}
else
{
txtStartStop.Text = "Start";
divRestartServer.Visible = false;
}
I need to add a parameter to helper.GetServiceRunning, i was thinking it
would be mighty handy if i could just put this code in a .cs file and
include it at the right point on every page, then any changes/additions
would be dead easy later on.
I'm using Visual Studio .Net 2003 if it will pre-process anything to do
this.
Any ideas/insights would be very good
Its pretty frustrating when you need to go and change something =\
- Mark