CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: c# with .net

  1. #1
    Join Date
    Nov 2013
    Posts
    2

    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;}
            
        }
    }

  2. #2
    Join Date
    Nov 2013
    Posts
    2

    Re: c# with .net

    Someone?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured