开发者

Advice / opinions on using SubSonic 3.0.0.3 without MVC?

开发者 https://www.devze.com 2022-12-10 01:19 出处:网络
I use SubSonic 3.0.0.3 ActiveRecord with ASP.NET MVC and it is very nice. However, we run on IIS 6 and I tend to have quite a few issues with speed. I dont know if this is me being too paranoid but I

I use SubSonic 3.0.0.3 ActiveRecord with ASP.NET MVC and it is very nice. However, we run on IIS 6 and I tend to have quite a few issues with speed. I dont know if this is me being too paranoid but I was thinking of using SubSonic with just a normal ASP.NET WebForms website. Please forgive me for being thick but I'm so used to models and binding now that I can't think how to use SubSonic within a normal ASPX page.

For example and this would be enough to set me free. I have a product view page .aspx and in that I would pull down data using the SubSonic code, bu开发者_Go百科t then there is my page end I'm a little confused about, I don't have any example code as I would like to see what is said about this and if me running MVC and SubSonic on IIS 6 is a BAD thing.


I don't think you are really asking the right questions, in my opinion. Whether you are using IIS6 or IIS7 and/or MVC or Webforms shouldn't have any impact on the feasibility of using Subsonic. That is, Subsonic should work just fine with any platform combination.

If performance is critical, you certainly need to consider that Subsonic or any ORM is never going to be quite as fast as pure ADO.NET code that you could write and optimize on your own. Having said that, odds are your performance bottleneck has nothing to do with this.

Using Subsonic in an .aspx page is just like you would in MVC, the only difference being now you'll bind any data directly to controls rather than passing into a view:

protected void Page_Load(object sender, EventArgs e)
{
    var products = Product.GetPaged(1, 20);
    productsGridView.DataSource = products;
    productsGridView.DataBind();
}

To answer your last question more succinctly: using Subsonic would not be a BAD thing, at least not for the reasons you mentioned.

0

精彩评论

暂无评论...
验证码 换一张
取 消