-
November 11th, 2013, 09:18 AM
#1
c# with .net
Hi guys,
I am building a website in visual studio with c#, Html, Razor, Css. I use the MVC principal.
Why do i get this error? Error 10 Member 'Opdracht1Prog6.Models.ASPText.Text' cannot be accessed with an instance reference; qualify it with a type name instead C:\Users\Snowwhite\Documents\Visual Studio 2012\Projects\MvcApplication6\MvcApplication6\Controllers\TextController.cs 14 20 Opdracht1Prog6
Controller
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Opdracht1Prog6.Models;
namespace Opdracht1Prog6.Controllers
{
public class TextController : Controller
{
public ActionResult ASPBook()
{
var asptext = new ASPText();
asptext.Text = "ASP.NET MVC 4 in Action is a hands-on guide that shows you how to apply ASP.NET MVC effectively. After a high-speed ramp up,/n " +
"this thoroughly revised new edition explores each key topic with a self-contained example so you can jump right to the parts you need. Based on thousands of hours of real-world experience,/n" +
"the authors show you valuable high-end techniques you won't find anywhere else. Written for developers, the book arms you with the next-level skills and practical guidance to create compelling web applications./n " +
"You need some knowledge of ASP.NET and C#, but no prior ASP.NET MVC experience is assumed.";
return View(asptext);
}
}
}
Model
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Opdracht1Prog6.Models
{
public class ASPText
{
public String Text {get; set;}
}
}
-
November 11th, 2013, 11:24 AM
#2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|