Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this error mean: Member modifier 'public' must precede the member type and name

I have a problem with my viewresult for my index page. I have searched here and on Google for the solution. So here is my code.

public class UserController : Controller
{
    private ProjectsDB db = new ProjectsDB();
    //
    // GET: /User/
    EnvironmentVariableTarget 

    public ViewResult Index()
    {
        var model = from p in db.Projects where p.UserName == User.Identity.Name select p;
        return View(model);
    }

And this is my error:

Member modifier 'public' must precede the member type and name.

What am I doing wrong?

like image 881
Frazzle Avatar asked Jul 05 '12 15:07

Frazzle


1 Answers

That EnvironmentVariableTarget part is wrong. It shouldn't be there, that's why you get the error on the next sentence

like image 125
pollirrata Avatar answered Sep 30 '22 18:09

pollirrata