| | |
Porting asp to asp.NET (with fileup)
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
I am in the process of porting most of our asp apps. to asp.NET and have come across one headache. The process uses two forms to upload images, check they are valid image files, check to see if there are already any registed within the database and delete the old ones, then upload the new ones and record the path within the database.
It gets to ContentType validation with the line :-
==================================================
Line 90: if ( upl.Form(item).ContentType = "image/gif" OR upl.Form(item).ContentType = "image/jpeg" OR upl.Form(item).ContentType = "image/pjpeg") then
=================================================
and then blows out with:-
=============================================
Public member 'ContentType' on type 'String' not found.
Exception Details: System.MissingMemberException: Public member 'ContentType' on type 'String' not found.
============================================
Perhaps I have been staring at this too long, but something is not making any sense. It all worked fine under asp (new attributes like isReference have replaced old ones like isObject -and the usual stuff that stops asp from functioning under .NET)
Any ideas would be appreciated!
It gets to ContentType validation with the line :-
==================================================
Line 90: if ( upl.Form(item).ContentType = "image/gif" OR upl.Form(item).ContentType = "image/jpeg" OR upl.Form(item).ContentType = "image/pjpeg") then
=================================================
and then blows out with:-
=============================================
Public member 'ContentType' on type 'String' not found.
Exception Details: System.MissingMemberException: Public member 'ContentType' on type 'String' not found.
============================================
Perhaps I have been staring at this too long, but something is not making any sense. It all worked fine under asp (new attributes like isReference have replaced old ones like isObject -and the usual stuff that stops asp from functioning under .NET)
Any ideas would be appreciated!
•
•
Join Date: Jul 2004
Posts: 1
Reputation:
Solved Threads: 0
I suppose "upl" is of type SoftArtisans.Net.FileUp,
so, have you ever tried casting?
Like replacing
[VB]
if ( upl.Form(item).ContentType = "image/gif" OR upl.Form(item).ContentType = "image/jpeg" OR upl.Form(item).ContentType = "image/pjpeg") then
with something like
[C#]
if ( ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/gif" || ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/jpeg" || ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/pjpeg" )
{ ... }
(I'm sorry, I can read most of VB.net but I can't write it. But I figure you will get my point after all.)
so, have you ever tried casting?
Like replacing
[VB]
if ( upl.Form(item).ContentType = "image/gif" OR upl.Form(item).ContentType = "image/jpeg" OR upl.Form(item).ContentType = "image/pjpeg") then
with something like
[C#]
if ( ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/gif" || ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/jpeg" || ((SoftArtisans.Net.SaFile)upl.Form(item)).ContentType == "image/pjpeg" )
{ ... }
(I'm sorry, I can read most of VB.net but I can't write it. But I figure you will get my point after all.)
•
•
•
•
Originally Posted by rompa
(I'm sorry, I can read most of VB.net but I can't write it. But I figure you will get my point after all.)
I have the same problem with C#.
Since posting this I have run into a number of brick walls - the main problem being the way Fileup treats asp and asp.NET in two different ways, so just porting an existing asp app. is not going to work - it was back to basics and then more hassles with Database connections (a ported asp app. will allow OLEDB connections via MS Provider for ODBC connections but pure asp.NET will not) and a host of other. The same old Micro(spit)soft hassle - if you don't use their SQL Server (how did they get away with naming a commercial Database product after a language anyway? - 'nuther soapbox!) then compatability is a joke! We were totally unable to use .NET with a Sybase back end with Framework 1.0 but the later version has improved things - a bit!
![]() |
Similar Threads
- FREE Domain, 4 Months FREE, starts at $1.95/mo. Linux, Windows, ColdFusion and More.. (Web Hosting Deals)
- ASP in ASP.NET application (ASP.NET)
- Running asp or asp.net on apache (Linux Servers and Apache)
Other Threads in the ASP.NET Forum
- Previous Thread: .Net Developer Oppty - Kronos, Chelmsford, Massachusetts
- Next Thread: Regarding ListItem Class
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv gridview gudi iis javascript list listbox login menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers





