Code behind query

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
 
K

Kevin Spencer

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.
 
P

Poppy

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 ???
 
W

wh

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.
 
N

nfedin

You do not need to compile your code behind files into the DLL in the
/bin. Not having VS.Net, I don't know what the behavior of it is. My
sites, I have the aspx/ascx page and then a corresponding code behind.
I simply tell the page where the code behind is in the Page/Control
directive, i.e.

<%@ Page Language="VB" Src="CodeBehind/Default.aspx.vb"
Inherits="DefaultClass" %>

When the page is changed, it gets recompiled it first referenced. I
would do this.

I do not know if this solution is faster than the compiled DLL.
Others would be able to answer that.

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top