Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clarify Compatibility - .NET Framework 1.1

Status
Not open for further replies.

Melagan

MIS
Nov 24, 2004
443
US
Good day,

With regard to ASP.NET 1.1, there are two things that I am struggling with. One is master pages - are they just out-right incombatible with 1.1?

The other issue is code-behind files. I found a listing the other day that offered a slightly different syntax for 1.1 than 2.0, and am wondering if this is correct:

Here is the 2.0 way:
Code:
<!-- .aspx file -->
<%@ Page Inherits="_Default" CodeFile="default.aspx.vb" %>

<!-- aspx.vb file -->
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Public Class _Default : Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     'Do something here
    End Sub
End Class

Now the 1.1 way, where you have to explicitly give the codefile a Namespace:

Code:
<!-- .aspx file -->
<%@ Page Inherits="myNameSpace._Default" %>

<!-- aspx.vb file -->
Namespace MyNameSpace

    Partial Class _Default : Inherits System.Web.UI.Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     'Do something here
        End Sub
    End Class

End Namespace

Those are my two questions for the day! The first one I expect yes/no, and the second I'm just looking for an explination on why the 1st method doesn't work in ASP.NET 1.1

Thank you.

~Melagan
______
"It's never too late to become what you might have been.
 
1.) In 1.1 there are no "master pages". You would inherit a page. 2.0 now has master pages. Not sure what you mean by incompatiable. You can only use master pages with 2.0

2.) I think yoiu have the 2 code blocks reversed. 2.0 now uses partial classes. in 1.1 you would need the full namespace.
 
For 1) - What I meant by incompatible, I could rephrase as "not availble". Master Pages are not available in 1.1; I understand.

For 2) I understand now that 1.1 uses full namespaces while 2.0 uses partial classes. Thank you!


Now of my webhost would just upgrade their servers to Framework 2.0 I'll be in good shape =) It is very confusing to read out of forums and books that supply Framework 2.0 information, then try some code and have it work in VWD's development environment but not on my webhost [neutral]

~Melagan
______
"It's never too late to become what you might have been.
 
Its official - I am stuck with .NET 1.1 for another few months, but I am really wanting to move forward with some of my projects. I know there are some significant differences between 1.1 and 2.0, but with regards to the aforementioned Master Pages, do you suppose user controls for UI presentation would be a suitable substitute until I can utilize master pages?

I am just looking to have a three column layout with a header and footer, using only <div> elements and CSS. I have the <div> and CSS part down, and am wondering if it would be effective to have each section as its own user control. In the end, I would end up with user controls for my header, footer, left column, and right column, while the center column would be the .aspx page itself.

How does that approch sound?

~Melagan
______
"It's never too late to become what you might have been.
 
That approach sounds reasonable. You could also place those usercontrols on a page and use that page to inherit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top