Code behind query

  • Thread starter Thread starter Poppy
  • Start date Start date
P

Poppy

I have a solution developed in VS.net.

It has been pointed out to me that code behind pages cannot be altered on
the site as the solution would need recompiling to update the dll in the
/bin folder.

Unfortunatly there is 1 page on my site which I need to frequently change
slightly and I dont want to have to recompile every time.

If I excluded this page from my project but uploaded it to my site could I
then alter it and see the changes ?

Thanks in Advance
 
What is it aht you need to change frequently in a page? If it's content, why
don't you put have the Page fetch the content dynamically, so that you can
simply change the content without recompiling?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
It's much more complicated then that.

I can not do this dynamically.

All I want to know is :
If I exclude it from my project can I alter that page without having to
recompile ???
 
I think this is possible providing you exclude the page from your project.

Assuming you have a page called "page.aspx", VS.Net will add a directive
similar to the following at the top of the file:

<%@ Page language="c#" Codebehind="page.aspx.cs" AutoEventWireup="false"
Inherits="YourNamespace.Page" %>

Assuming that you need to modify the code-behind file (in this case
page.aspx.cs), just specify one additional 'src' parameter to the @page
directive:

<%@ Page language="c#" Codebehind="page.aspx.cs" AutoEventWireup="false"
Inherits="YourNamespace.Page" src="page.aspx.cs" %>

This should instruct the .NET framework to compile page.aspx.cs the first
time the page is accessed (or the first time that the code-behind file has
been modified), ensuring that it uses the most up to date changes.

Wayne.
 
Back
Top