Codebehind problem

  • Thread starter Thread starter Francisco Carvalho
  • Start date Start date
F

Francisco Carvalho

I have created a user control that gets loaded by a page.
The user control has a codebehind, but when I change the
code on the codebehind, it never runs.
If on the other hand a run the same code on the .ascx
file it runs with no problems.
The directive(see below) was added automatically by
VS.NET so I can't seam to know what the problem is. Any
thoughts?
Francisco

<%@ Control Language="vb" AutoEventWireup="False"
Codebehind="idx_CSS.ascx.vb" Inherits="nova.idx_CSS"
TargetSchema="http://schemas.microsoft.com/intellisense/ie
5" %>
 
Francisco,
You need to rebuild the project in VS.NET. Using the VS.NET code behind
model pre-compiles all of the code behind files into a single assembly,
located in your /bin folder. If you change the code in the code-behind
file, ASP.NET still uses the compiled assembly, so until you rebuild the
project (and thus compile the assembly), nothing is changed. On the other
hand, the ascx file is always parsed from the actual file, so changes there
are reflected immediately.

Ryan
 
Hi Ryan,

Thanks for the reply. I did rebuil the solution, but with
no success. I then deleted the dll from within the VS.NET
enviroment and build the project. That recreated the dll,
which fixed the probelm. Thanks a lot.

Francisco
 
Back
Top