1 Replies - 1742 Views - Last Post: 16 June 2012 - 04:46 PM

#1 deathxmortis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-April 12

MVC: cannot use <%=Model.etc; %> , forced to use % Response.Wr

Posted 16 June 2012 - 03:54 PM

As the questions says, Im forced to use the <% Response.Write(Model.Something); %> instead of the shortcut <%=Model.Something; %> in ASP.NET using MVC2, on Visual Studio 2010. Cant figure out why? maybe something to do with the web config...

I was just doing simple stuff to brush up on some MVC stuff, :whatsthat:. It will always throw me a "Compiler Error CS1026" and tells me that I need to close " ) " in my View.

This gets me an error:
 The id is <%=Model.id; %>

This does not:
 The id is <%Response.Write(Model.id); %>


Is This A Good Question/Topic? 0
  • +

Replies To: MVC: cannot use <%=Model.etc; %> , forced to use % Response.Wr

#2 deathxmortis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-April 12

Re: MVC: cannot use <%=Model.etc; %> , forced to use % Response.Wr

Posted 16 June 2012 - 04:46 PM

Wow!!!! This was stupid!

Just delete the f*ing comma!
<%=Model.id %>


Need to sleep, sorry for wasting bytes in the database!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1