Codebehind problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Francisco Carvalho

    #1

    Codebehind problem

    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="h ttp://schemas.microso ft.com/intellisense/ie
    5" %>

  • Ryan Gregg

    #2
    Re: Codebehind problem

    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


    "Francisco Carvalho" <fcarvalho@carf .org> wrote in message
    news:04f101c34c ac$f3cfbeb0$a30 1280a@phx.gbl.. .[color=blue]
    > 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="h ttp://schemas.microso ft.com/intellisense/ie
    > 5" %>
    >[/color]


    Comment

    • Francisco Carvalho

      #3
      Re: Codebehind problem

      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
      [color=blue]
      >-----Original Message-----
      >Francisco,
      > You need to rebuild the project in VS.NET. Using[/color]
      the VS.NET code behind[color=blue]
      >model pre-compiles all of the code behind files into a[/color]
      single assembly,[color=blue]
      >located in your /bin folder. If you change the code in[/color]
      the code-behind[color=blue]
      >file, ASP.NET still uses the compiled assembly, so until[/color]
      you rebuild the[color=blue]
      >project (and thus compile the assembly), nothing is[/color]
      changed. On the other[color=blue]
      >hand, the ascx file is always parsed from the actual[/color]
      file, so changes there[color=blue]
      >are reflected immediately.
      >
      >Ryan
      >
      >
      >"Francisco Carvalho" <fcarvalho@carf .org> wrote in[/color]
      message[color=blue]
      >news:04f101c34 cac$f3cfbeb0$a3 01280a@phx.gbl. ..[color=green]
      >> I have created a user control that gets loaded by a[/color][/color]
      page.[color=blue][color=green]
      >> The user control has a codebehind, but when I change[/color][/color]
      the[color=blue][color=green]
      >> 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"
      >>[/color][/color]
      TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie[color=blue][color=green]
      >> 5" %>
      >>[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...