Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    Loughborough (UK)
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP.NET 1.1 to 2

    Hi all,

    This is a bit of a long shot, but can anybody explain the fundamental difference between ASP.NET 1.1 and 2, in particular the link-up of the ASPX page and ASPX.CS page. I have been building 1.1 apps in notepad for a couple of years with no trouble. I have recently downloaded Framework 2. My code compiles with no error message using framework 2, but the server cannot parse the page - muttering something about not being any to inherit from the codebehind.

    I have tried desperately to find tutorials on the migration, but everything assumes the developer is using Visual Studio - which I am not!

    Any ideas or help would make you my new best friend... ...or I can just say "thank you" if you prefer!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    this is my standard directive in an aspx page:
    <%@ Page Language="C#" %>
    <%@ import Namespace="the.full.namespace.of.the.codebehind" %>
    I am the luckiest man in the world

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    Loughborough (UK)
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks!

    Wow, thanks - didn't expect a reply on this one at all! You make it look very easy. So, the following directive, taken from a page within my application, would be stripped as follows:

    <%@ Page language="c#" Codebehind="SignIn.aspx.cs" AutoEventWireup="false" Inherits="Trinder.THA.Admin.Web.SignIn" %>

    to

    <%@ Page language="c#" import Namespace="Trinder.THA.Admin.Web.SignIn" %>

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    Test it, then you know
    I am the luckiest man in the world

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Location
    Loughborough (UK)
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it partially sorted in the end. Anybody else converting from 1.1 to 2.0 - it appears you only have to change the following:
    - in the aspx page change the codeBehind="" to codeFile=""
    - remove the ID from the form tag
    - remove the control declarations at the top of your aspx.cs page
    - add the word 'partial' in your aspx.cs page to read 'public partial class'

    My problem now is that the class I inherit from on every page (one that replaces the standard Page namespace) cannot be found... according to Visual Studio. Haven't figured this one out

    Any help/ideas anybody?

  • #6
    Regular Coder
    Join Date
    Nov 2002
    Location
    Loughborough (UK)
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Ignore me! Being thick as usual! Just needed to put the base page class into the app_code folder. I'm beginning to like this ASP.NET 2.0


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •