Wrox Programmer Forums
|
BOOK: Beginning ASP.NET Web Pages with WebMatrix
This is the forum to discuss the Wrox book Beginning ASP.NET Web Pages with WebMatrix by Mike Brind, Imar Spaanjaars ; ISBN: 978-1-1180-5048-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Web Pages with WebMatrix section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2012, 01:24 PM
Registered User
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 8 error

I am on chapter 8 and unable to sole this error
Created a new file Default.cshtml
The code is as follows:
@{
var message = "";
if(Request.Files.Count > 0) {
WebImage image = WebImage.GetImageFromRequest();
if(image != null) {
message ="Upload successded";
}else{
message="You must upload an image file: .jpg, .gof, .png, .tif";
}

}
}

<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8" />
<title>My Site's Title</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
</head>
<body>
<h1>Upload Images</h1>
<div>@message</div>
@Fileupload.GetHtml(allowMoreFilesToBeAdded:false )
</body>
</html>
I get a compiler error message:CS0103: The name 'Fileupload' does not exist in the current context
I have looked on the internet and was told that to install web helper 1
I have tried web helper 1, 1.1 and 1.5
I am using webmatrix2
Thaks
 
Old November 17th, 2012, 08:42 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Did you try FileUpload with a capital U?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 17th, 2012, 04:45 PM
Registered User
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Chapter 8

Thanks Imar. That worked. Just changing the upload to Upload





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 15. "Sign Up for new account" gets error: 26 - Error Locating Server/Instance Tanya Roslyakova BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 March 8th, 2011 10:34 AM
Error in Chapter 8 RolandTumble BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 3 February 28th, 2011 08:45 AM
example error chapter 3 RPA Solutions BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 April 25th, 2009 09:28 AM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.