...

View Full Version : ASP.NET 1.1 to 2



christrinder
02-28-2007, 01:26 PM
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... :eek: ...or I can just say "thank you" if you prefer! :rolleyes:

Roelf
02-28-2007, 01:43 PM
this is my standard directive in an aspx page:
<%@ Page Language="C#" %>
<%@ import Namespace="the.full.namespace.of.the.codebehind" %>

christrinder
02-28-2007, 01:51 PM
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" %>

Roelf
02-28-2007, 02:12 PM
Test it, then you know :thumbsup:

christrinder
02-28-2007, 06:00 PM
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?

christrinder
02-28-2007, 09:33 PM
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 :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum