By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,500 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

New Code without Recompilation - how can this be done?

P: n/a
Hi. I have been asked to do a rather odd thing by my employer. I have
to add a new feature to an old project that "should not know about the
change". This is a bit of an odd request but just assume that my
reasons for doing what I need to do cannot change.

Assume that I need to add a list box to the pre-existing project page
that uses some server code to grab its value.

The ony way I can think of doing this is to open notepad on
the given aspx file (Default.aspx) and add a client script with an
ajax call to some server page that handles the request and returns the
value that needs to go in the text box.

The question I have - is it possible to place the AJAX server page
under the root level of the project that I cannot recomplie? Will this
work? Does the project need to "know" about the ajax page or can it
live in the project without it being complied code? Or, do I have to
make a call external to the "non-recomplied" project?

In essense, how can i add a list box to a pre-existing project and
call values from new server code without recompiling the project?

I know this is weird but it is what I have been asked to do. :(

Please help!!

Thanks.
Jun 30 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jun 29, 9:14*pm, pbd22 <dush...@gmail.comwrote:
Hi. I have been asked to do a rather odd thing by my employer. I have
to add a new feature to an old project that "should not know about the
change". This is a bit of an odd request but just assume that my
reasons for doing what I need to do cannot change.

Assume that I need to add a list box to the pre-existing project page
that uses some server code to grab its value.

The ony way I can think of doing this is to open notepad on
the given aspx file (Default.aspx) and add a client script with an
ajax call to some server page that handles the request and returns the
value that needs to go in the text box.

The question I have - is it possible to place the AJAX server page
under the root level of the project that I cannot recomplie? Will this
work? Does the project need to "know" about the ajax page or can it
live in the project without it being complied code? Or, do I have to
make a call external to the "non-recomplied" project?

In essense, how can i add a list box to a pre-existing project and
call values from new server code without recompiling the project?

I know this is weird but it is what I have been asked to do. :(

Please help!!

Thanks.
Hi,

Well you might be even more surprised to know that it can be done :)
First, you need to modify the aspx, in there you change the @page
directive and especifically the Inherits attribute , you set the new
value to the name of a class you are going to create: MyClassA

then you make this new class inherit from the "old" class:
so if you have this:
<%@ Page Language="C#" Codebehind="Default.aspx.cs"
Inherits="Default" %>
and n the code behind:
public partial class Default: Page

you end with
<%@ Page Language="C#" Codebehind="Default1.aspx.cs"
Inherits="myNewPage" %>
and n the code behind:
public partial class myNewPage: Default
Jun 30 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.