471,337 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

New Code without Recompilation - how can this be done?

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
1 1124
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.

Similar topics

1 post views Thread by Andy | last post: by
19 posts views Thread by Vinod | last post: by
3 posts views Thread by arunal2001 | last post: by
5 posts views Thread by Jason Collins | last post: by
29 posts views Thread by John Rivers | last post: by
4 posts views Thread by VB Programmer | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.