我的ISP不支持ASP.NET MVC。我还能用它吗?

时间:2022-11-14 04:13:24

My ISP doesn't have ASP.NET MVC installed on their servers yet, although they do have .NET Framework 3.5 SP1 so they do have the new routing engine.

我的ISP还没有在他们的服务器上安装ASP.NET MVC,尽管他们确实有.NET Framework 3.5 SP1,所以他们确实有新的路由引擎。

It occurs to me that, if I create a model using Linq to SQL, it's possible to expose parts of the model as properties in the code behind. I could then render them in the web page (my "view") in the usual MVC way:

在我看来,如果我使用Linq to SQL创建模型,则可以将模型的某些部分公开为后面代码中的属性。然后我可以用通常的MVC方式在网页(我的“视图”)中呈现它们:

<%= myModel.MyField %>

I realize that I don't have Html Helpers (or maybe I do, if I copy the MVC dll to my website directory?), but I can live with that. I don't have controllers either, but I can simulate one in the Page_Load event of the CodeBehind.

我意识到我没有Html Helpers(或者我可以,如果我将MVC dll复制到我的网站目录中?),但我可以忍受。我也没有控制器,但我可以在CodeBehind的Page_Load事件中模拟一个。

Are there problems with this that I am not aware of? Have you tried something like this, and how did it work out for you?

我不知道有这个问题吗?你有没有试过这样的东西,它是如何为你效力的?

2 个解决方案

#1


Yes, you can still use ASP.NET MVC. Read this: Haacked - Bin Deploying ASP.NET MVC

是的,您仍然可以使用ASP.NET MVC。阅读本文:Haacked - Bin部署ASP.NET MVC

#2


Add the MVC dlls to your bin directory. We don't install ASP.Net MVC on production servers

将MVC dll添加到bin目录中。我们不在生产服务器上安装ASP.Net MVC

#1


Yes, you can still use ASP.NET MVC. Read this: Haacked - Bin Deploying ASP.NET MVC

是的,您仍然可以使用ASP.NET MVC。阅读本文:Haacked - Bin部署ASP.NET MVC

#2


Add the MVC dlls to your bin directory. We don't install ASP.Net MVC on production servers

将MVC dll添加到bin目录中。我们不在生产服务器上安装ASP.Net MVC