English 中文(简体)
Is inline coding with razor the only option with webmatrix?
原标题:
  • 时间:2010-07-06 23:00:22
  •  标签:
  • webmatrix

Or is it also compatible with asp.net or asp.net mvc?

最佳回答

Check out this great post from Dave Ebbo: Link

WebMatrix is really a tooling story, that comes with a stack (IIS Express, SQL CE 4 and Razor) enabling you to create a new breed of ASP.NET page or site. Not only can you use WebMatrix to edit and maintain traditional ASPX pages (a la Forms or MVC), but you can use WebMatrix to edit PHP files, work with MySQL databases and manage PHP-based open-source apps (WordPress, Joomla, etc.)

Bottom line: inline with Razor is not the only option when using WebMatrix, though it is the default when creating new pages.

问题回答

WebMatrix only supports a folder-based project (i.e. a WebSite, not a Web Application Project). Because of this ASP.NET MVC is not supported.

However, you can have pure .cs files that you can reference from your .cshtml files. Just drop them in the App_Code folder.

Scott Guthrie s blog post shows examples of inline code with both razor and regular asp.net tags. Webmatrix is just a "work environment" - it lets you edit ASP.Net and ASP.Net MVC pages, it s not exclusive of them.

As far as I understand it, razor syntax is just built on top of existing ASP.Net parsing, and you can choose to use it exclusively or mix it in with older ASP.Net stuff with no problems. I could be off on that though.





相关问题
IIS Express (WebMatrix) open for outside connections

I ve already enabled firewall rules for IIS Express (HTTP Traffic In) and IIS Express (HTTPS Traffic In) on ports 80 and 2012 (this one is used in WebMatrix), but I can t connect to the server from my ...

jQuery post from ASP.NET web page (WebMatrix)

I m trying to submit form data with jQuery. I m using ASP.NET WebMatrix. In a .cshtml file I have @{ // other code if(IsPost) { var item = new Item(); item.Title = ...

热门标签