Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Beginners question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
johan - 24 Jul 2007 18:42 GMT
Hello, I am new to asp.net.
I want to write an asp file that sends a gif image to my client img tag
as follows:

<img src=img_script.asp>Hello</img>

In my img_script.asp file I therefore need to open the image
with binary reader like so:

Imports System.IO
Dim fs As FileStream = New FileStream("c:\data.txt", FileMode.Open)
Dim r As BinaryReader = New BinaryReader(fs)

I received the following error:

Technical Information (for support personnel)

 a.. Error Type:
 Active Server Pages, ASP 0221 (0x80004005)
 The specified 'Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" ' option is unknown or
invalid.
 /t.asp, line 1
Thank you in advance for any assistance in solving this problem.
Peter Bucher [MVP] - 24 Jul 2007 18:52 GMT
Hi johan

> Hello, I am new to asp.net.
> I want to write an asp file that sends a gif image to my client img tag
> as follows:
>
> <img src=img_script.asp>Hello</img>
ASP <> ASP.NET
Use one of these, do not mix their file extension or syntax ;-)

> In my img_script.asp file I therefore need to open the image
> with binary reader like so: [...]
Its better to use a HttpHandler instead of an ASPX Page.

> I received the following error: [,,,]
This is because you are using ASP.NET Code on a file with the extension from
"old" classic asp -> site.asp

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Brandon Gano - 24 Jul 2007 18:53 GMT
Hi johan,

You need to be sure you have ASP.NET installed on your web server, than use
the .aspx extention instead of .asp.

Brandon

> Hello, I am new to asp.net.
> I want to write an asp file that sends a gif image to my client img tag
[quoted text clipped - 20 lines]
>  /t.asp, line 1
> Thank you in advance for any assistance in solving this problem.
johan - 24 Jul 2007 20:31 GMT
I see, it does work now,

How do I get intelisense to work? I am using vs2003 on a standalone aspx
file?

...and how do I interface BinaryReader to Response.BinaryWrite?

BinaryWrite expect a 'var' type

Can I do it in one go or do I need to loop till EOF etc

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.