Forum Moderators: open

Message Too Old, No Replies

.aspx and Netscape

can't handle this file...

         

bgirl

12:39 am on Aug 23, 2004 (gmt 0)

10+ Year Member



Taking my first baby steps into ASP.NET (I'm a php'er). When using the .aspx extension (just a template to have programming added later) and opening the file in Netscape 7.1 Mac & Netscape 7.01 PC I get an error...

Mac: "The file blah.aspx is of type application/octet-stream (Untyped Binary Data), and Netscape does not know how to handle this file type." Open save to disk etc.

PC: "You have chosen to download a file of type: application/octet-stream from..."

Is this a server configuration issue? It's hosted on a Win2K box. Opens fine on IE, Safari, Opera without any added fussing (Opera displays the file, but doesn't like the VB language header, spits it out as text at the top of the page when it's the second line).

Here's the doctype I'm using:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>

Is .NET installed on Win2K?

Xoc

3:40 pm on Aug 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The @Page directive should appear above the DOCTYPE. I'm not sure that is the problem though. The issue is that the HTTP Header has the wrong mime type (ftp://ftp.isi.edu/in-notes/iana/assignments/media-types). You can check what the header is sending by using this page: [searchengineworld.com...]

duckhunter

5:35 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



Is .NET installed on Win2K?

No, not by default. The Framework and IIS components must be installed seperately.

bgirl

10:02 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



The @Page directive should appear above the DOCTYPE.

I tried it both ways... didn't seem to make a difference, though I've heard the doctypes don't work in some browsers if any code is listed before it. Myth? True?

I'll check out the mime-type links... thanks.

bgirl

10:05 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



No, not by default. The Framework and IIS components must be installed seperately.

I'll have to check my config - it's my first time managing a colocated server... gives me a renewed respect for web hosting companies :)

Small Website Guy

11:25 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



If you are creating .ASPX files without the Visual Studio development environment, you are making it a lot harder.

Visual Studio will create a starter ASPX page for you with the @Page directive and a DOCTYPE and everything else that needs to be there.

But that's besides the point. I suspect that you simply either (1) don've have IIS and the .NET framework installed on the computer, or (2) they are installed, but you didn't put the ASPX file in a directory that's recognized by IIS as being a web directory.

If IIS and the .NET framework were set up right, you wouldn't get an error in Netscape if your page was bad, you'd get an ASP.NET error message.

bgirl

11:46 pm on Aug 23, 2004 (gmt 0)

10+ Year Member



If you are creating .ASPX files without the Visual Studio development environment, you are making it a lot harder.

Isn't that what it's all about? Making it harder... I'm using a combo of DWMX/Homesite/TopStyle and haven't even touched MS development tools. DW did generate the doctype + directives I used.

But that's besides the point. I suspect that you simply either (1) don've have IIS and the .NET framework installed on the computer, or (2) they are installed, but you didn't put the ASPX file in a directory that's recognized by IIS as being a web directory.

I suspect it isn't installed. When the host turned the server over to me I asked "Is .NET installed?" and they replied "What's that?".

duckhunter

2:22 am on Aug 24, 2004 (gmt 0)

10+ Year Member



I asked "Is .NET installed?" and they replied "What's that?".

Definitely time for a new host. I wouldn't recommend being their first .NET deployment unless your a patient person considering you are learning the language. There's a great deal more to managing a .NET environment that there has been in the past with classic ASP/IIS4.

If you are creating .ASPX files without the Visual Studio development environment, you are making it a lot harder.

It's not only harder, it's not possible to take advantage of the .NET features unless you have the Visual Studio Dev Environment to Compile the Project DLL. Without the code behind modules running you're just creating ASP pages with a different extension. ASP pages will still run on a .NET server, ASPX pages are intended to utilize the Framework which can consist of classes and objects running beneath the HTML.

bgirl

3:06 am on Aug 24, 2004 (gmt 0)

10+ Year Member



Definitely time for a new host.

Yeah, I've tried that route, but since they're in the same building as my client, they feel obligated to stay. And I feel obligated to charge them my full rate for that decision :)

I wouldn't recommend being their first .NET deployment unless your a patient person considering you are learning the language... Without the code behind modules running you're just creating ASP pages with a different extension.

You're right, I CAN avoid the whole .NET experience, the only reason for using ASP in this case is for a PDF generating scenario and I think I'll be using ActivePDF Toolkit. Though I don't mind being the experimental monkey as long as I'm not roasted in the process.

This gives me a lot to think about. Like...

What is the basic difference between ASP and ASP.NET, or more practically, in what kind of scenario would someone want to choose one over the other?

Any particular advantages to .NET?

I will be doing more reading on this. Any good 1-2-3 reference recommendations off the top of your head(s)?

duckhunter

8:06 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



bgirl,
There aren't many comparisons between classic ASP and .NET. They are two completely different approaches to developing software. Many say that having a background in ASP is actually a detriment since you naturally try to apply ASP coding techniques when, in fact, it's a complete rewrite.

ASP is HTML with embedded VB Functions

.NET is a true object oriented programming language. .NET web applications consist of two main components: HTML/Presentation and the code behind. The best comparison is likened to a Visual Basic EXE where you have Forms for the user to navigate. These forms have methods (button_click, page_load, etc.) that call classes and modules to derive results to be passed to the GUI. This is the same approach to use in .NET web development.

An simple example:

Classic ASP


<HTML>
<BODY>
The name of my favorite color is: <%=GetColor%>
</BODY>
</HTML>

<%
Function GetColor
Return "Green"
End Function
%>

.NET

<HTML>
<BODY>
The name of my favorite color is: <asp:Label id=MyColor runat="server"></asp:Label>
</BODY>
</HTML>

Then in the Code Behind module (default.vb)

Private Sub Page_Load
Me.MyColor.Text = "Green"
End Sub

Hope this helps. This example is using VB.NET. You also have the choice of C# or even C++ as well. If it looks like ASP is a more straight-forward approach and easier to code, you are right but more complex systems and coding will give you greater flexibility when using .NET. You will develop several .NET applications before you decide what methods work best for you. Best advice is to sign up for a class and get a good overview before you start blindly and develop bad habits.

bgirl

8:56 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



Hope this helps...Best advice is to sign up for a class and get a good overview before you start blindly and develop bad habits.

Yes, thanks Duckhunter. Nice example. It is clear that .NET isn't one of those server-side languages the average joe-coder can just pick up and run with.

Small Website Guy

10:42 pm on Aug 24, 2004 (gmt 0)

10+ Year Member



What is the basic difference between ASP and ASP.NET, or more practically, in what kind of scenario would someone want to choose one over the other?

There is NO reason to use old ASP. ASP.NET is light years ahead. Faster, more powerful, easier to use to develop complex applications.

ASP.NET is the greatest web development tool ever developed.

Mind you that I don't think that everything Microsoft does is great. MS also wants you to use .NET for non-internet desktop applications, and I think that VB6 was easier to use and better for that. There's a lot that I hate about .NET for client/server.

But ASP.NET is fabulous. SQL Server is fabulous too. ASP.NET + SQL Server is well worth the additional hosting costs.

duckhunter

1:06 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



Yes, .NET rocks. The "cool factor" is off the scale for some of the stuff you can do.

bgirl

4:46 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



I'm a sucker for cool. What have you guys done with .NET?

duckhunter

7:03 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



The better question is what haven't you done with .NET. If you can dream it up, .NET has a way to get it in code (usually with more than 1 way to do it)

TheNige

8:06 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



Small Website Guy: I can't see why you would prefer VB6 above .Net forms.....man VB6 is lame compared to the features available in .Net Windows Forms. The best being xcopy deployment.

Small Website Guy

10:43 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



.NET desktop applications load incredibly slowly, and then the forms come up really slowly. Because of all that overhead going on behind the scenes. ASP.NET may be optimized, but the Windows Forms stuff sure isn't.

The grid control that comes with .NET sucks, it's ridiculously overcomplicated (you have to have a PhD in object oriented programing just to figure out how to change the color of a row), yet it's missing basic features like being able to put a combobox in a grid cell.

The ADO stuff with Datasets and Datatables is ridiculously overcomplicated as well.

duckhunter

3:08 am on Aug 26, 2004 (gmt 0)

10+ Year Member



I understand your point about the heavy startup of the desktop apps. The few I have done weren't complicated and yet I noticed the startup times. I do so love the ASP.NET stuff for the flexibility to integrate all kind of ideas.

>> The ADO stuff with Datasets and Datatables is ridiculously overcomplicated as well

I disagree here. The new ADO model has so much to offer. I prefer to stay away from any of the drag/drop objects like the grids/connections/etc. and produce my own HTML and object declarations. The drag/drop stuff off the toolbar needs some work to be 100%. If your in the desktop apps instead of the web, you're kinda stuck with that complicated grid.

Here's a "what have you done with .NET"
Using the System.Xml.XmlReader and the SQLClient to load in XML produced by a FOR XML select in SQL Server. The XML is transformed via XSLT to produce HTML on the fly. It's fast. Scary fast. This gives me a single XSLT to control the look/feel/layout of every "category" page and another XSLT for the product detail pages. Change 1 file and affect 000's of pages. Pretty sweet.

txbakers

6:43 pm on Aug 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With all the gee-gaw over .NET, let me put it simply.

.NET is a clone of JSP.

Where JSP is HTML + the entire Java Language capabilities, .NET is HTML + the entire C# (java) or VB or other language capabilities.

They function pretty much the same way.

Both compile your source code and present it to the end user as an HTML type page.

Which one is better? That's subjective.

Small Website Guy

12:00 am on Aug 29, 2004 (gmt 0)

10+ Year Member



A programming language is a programming language. Java and C# are nearly identical (Microsoft copied Java there) and even Visual Basic isn't really all that different from Java when you get down to it--especially the new object oriented flavor of VB.NET.

What makes .NET special is the .NET framework and the ASP.NET object model and server controls. And its ease of deployment. And its wonderful designer, Visual Studio.

Easy_Coder

4:06 am on Aug 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



txbakers -

I started to look seriously into java recently and your right... I've been writing c# for a couple of years now and I couldn't believe how similar the languages were when I started looking at java.

Makes it easier to come up to speed; which is a nice side benefit that I got when I choose c# over vb.net. Had I gone down the vb.net route; java would be a much steeper climb.

bgirl

7:03 pm on Sep 9, 2004 (gmt 0)

10+ Year Member



OK, so I took the big plunge into .NET and yeah there's a bit of a learning curve. Coming from a PHP background the first thing I hit that drove me nuts was:
"How the ____ do you include() code?".

Answer: User controls [dotnetjunkies.com].
That was painful. Using regular ASP #includes doesn't process code at the server.

It's still seeping into my coffee addled brain. The other thing, maybe helpful to others faced with a .NET project and have only PHP experience... use C#. It's way more like PHP. It uses ; at the end of lines, // for comments, but it is case sensitive so watch out there.

Now I'm exploring "web services" and what they can do. Anyone, and it's getting time to start a new thread, know if web services are private enough to use for a customer database?

Update: I installed .NET 1.1 with service pack 1 on a Win2K server and am a happy camper. Thanks to everyone.