tags:

views:

228

answers:

3
A: 

This is probably because the project didn't compile properly. Try to generate the View pages by right-clicking the controller method and click create view... and recompile...

Ropstah
That's how I generated my view.
Alex
What's the error-message when you hover error-underlined code?
Ropstah
CS1031 Type Expected. It's actually underlining different code but it goes away as soon as I remove the Url.Action part and works.
Alex
What code is it underlining? And what error messages do you get if you click [Ctrl]+[Shift]+[B] (Build Solution)?
Tomas Lycken
+1  A: 

The Url class in the examples is actually a property of the ViewPage, and also of the ViewUserControl, so if your application builds and you have your inheritances correctly set up, this shouldn't be possible.

Try rebuilding your solution a couple of times, and if that not helps restarting Visual Studio. (I used to have the same problem with the Html property, but I believe that was on one of the Preview releases, and I could solve it by upgrading to the next preview/the beta.)

Tomas Lycken
I've posted my entire page. Latest version of MVC. :(
Alex
+1  A: 

Solved it. The Url.Action(new("Register"))) was the problem. Url.Action("Register") works.

Thanks for your help though. This was hard to tackle because VS underlines the wrong code and gives confusion statements about problems. Glad its solved.

Alex