jQuery Mobile Directions ASP.NET或MVC

时间:2022-12-04 17:44:28

I work for a good sized healthcare organization as a web developer and have recently been tasked with developing a set of standards and possible reference applications for mobile development. Our current methodology relies heavily on asp.net 3.5 along with a large framework library that is common across all of our applications.

我作为一名Web开发人员为一家规模较大的医疗机构工作,最近负责为移动开发开发一套标准和可能的参考应用程序。我们当前的方法在很大程度上依赖于asp.net 3.5以及在我们所有应用程序中都很常见的大型框架库。

I have just begun to dabble with jQuery Mobile and it appears that any solution or direction we come up with will lean heavily on that framework.

我刚刚开始涉足jQuery Mobile,看来我们提出的任何解决方案或方向都将严重依赖于该框架。

Questions:

  1. Is it reasonable or not to attempt a jQuery Mobile solution on top of asp.net web forms? I realize that jQuery Mobile does not make use of post backs in a traditional web forms fashion, but can it be done? How much better would a MVC solution be? (I have worked with both and don't want to get into a bigger Web Forms vs MVC discussion but wonder if one just works better with jQuery Mobile than the other.)

    在asp.net Web表单上尝试jQuery Mobile解决方案是否合理?我意识到jQuery Mobile没有以传统的Web表单方式使用post backs,但可以做到吗? MVC解决方案会有多好? (我和两者都合作过,不想进入更大的Web Forms vs MVC讨论,但想知道jQuery Mobile是否能比其他的更好。)

  2. How is data saved within a jQuery Mobile application? I get the data-role="page" idea but is data typically saved to the back-end web server via ajax calls that do not rely on traditional client post backs? If not, then how? If it typically does rely on ajax, then is the idea of using Web Forms just silly?

    如何在jQuery Mobile应用程序中保存数据?我得到了data-role =“page”的想法,但是数据通常是通过不依赖于传统客户端回发的ajax调用保存到后端Web服务器的吗?如果没有,那怎么样?如果它通常依赖于ajax,那么使用Web Forms的想法是愚蠢的吗?

Thanks,

1 个解决方案

#1


1  

Our company is a large after-market parts supplier in North America. We currently have several asp.net web forms sites (moving away from) and a growing collection of MVC 3 Web Apps and APIs.

我们公司是北美的大型售后零件供应商。我们目前有几个asp.net Web表单站点(远离)和越来越多的MVC 3 Web应用程序和API。

We recently rolled out our first jQuery Mobile powered web app and it was surprising how easy it was. It did really help that this project was architected well and so the jqm site was able to gather most of its data and content quickly through our Core and Service layers.

我们最近推出了我们的第一个jQuery Mobile驱动的网络应用程序,令人惊讶的是它是多么容易。它确实有助于该项目的架构很好,因此jqm站点能够通过我们的核心层和服务层快速收集大部分数据和内容。

I highly recommend creating a template for building out your mobile pages. I'll update soon with a sample if that will help, its helped me tremendously because there is only so much you really want to push away into a master page. And I believe MVC 4 has jQuery Mobile packed into it as a new template.

我强烈建议您创建一个用于构建移动页面的模板。我会尽快更新样本,如果这会有所帮助,它对我帮助很大,因为只有你真的想要推进到母版页中。而且我相信MVC 4将jQuery Mobile作为一个新模板打包进去。

  1. No, I would think it would be difficult to transition an asp.net web forms site to jQuery Mobile (think ViewState nightmares). Yes, it can be done but in my experience, asp.net web forms are bulky compared to their MVC counterparts when constructed properly - but again maybe thats biased on my poor experiences with HTML bloat caused by ASP controls and ViewState.

    不,我认为将asp.net Web表单站点转换为jQuery Mobile(想想ViewState噩梦)会很困难。是的,它可以完成,但根据我的经验,asp.net网络表单与MVC对应物相比构建正确时笨重 - 但也许这可能是因为我对ASP控件和ViewState引起的HTML膨胀的糟糕体验。

  2. You can manage data in several ways using a jQuery Mobile powered site. With MVC, we use traditional form elements where needed or post back through ajax when it makes sense. Remember you can always turn off the default ajax page loads/posts with the data-ajax="false" attribute or at the app level with ajaxEnabled option. Of course, something get stuck directly into Session as needed. Often times, a mobile site is more for consuming data than producing it. Based on that philosophy, I would think that its ok to use ajax and therefore MVC may be a better choice.

    您可以使用jQuery Mobile支持的站点以多种方式管理数据。使用MVC,我们在需要时使用传统的表单元素,或者在有意义的情况下通过ajax回发。请记住,您始终可以使用data-ajax =“false”属性关闭默认的ajax页面加载/帖子,或者使用ajaxEnabled选项关闭应用程序级别。当然,根据需要,某些东西会直接陷入Session。通常情况下,移动网站比生产网站更多地消耗数据。基于这种理念,我认为可以使用ajax,因此MVC可能是更好的选择。

Maybe its just my view of things because I've had the luxury (and testability) of working with MVC over the last few years... but yeah, in contrast it may be silly to use an asp.net web form app with your organizations jQuery Mobile site if you could instead use MVC.

也许这只是我对事物的看法,因为我在过去的几年中拥有与MVC合作的奢侈(和可测试性)......但是,相比之下,使用asp.net web表单应用程序可能很愚蠢组织jQuery Mobile网站,如果你可以改为使用MVC。

Hope this helps!

希望这可以帮助!

#1


1  

Our company is a large after-market parts supplier in North America. We currently have several asp.net web forms sites (moving away from) and a growing collection of MVC 3 Web Apps and APIs.

我们公司是北美的大型售后零件供应商。我们目前有几个asp.net Web表单站点(远离)和越来越多的MVC 3 Web应用程序和API。

We recently rolled out our first jQuery Mobile powered web app and it was surprising how easy it was. It did really help that this project was architected well and so the jqm site was able to gather most of its data and content quickly through our Core and Service layers.

我们最近推出了我们的第一个jQuery Mobile驱动的网络应用程序,令人惊讶的是它是多么容易。它确实有助于该项目的架构很好,因此jqm站点能够通过我们的核心层和服务层快速收集大部分数据和内容。

I highly recommend creating a template for building out your mobile pages. I'll update soon with a sample if that will help, its helped me tremendously because there is only so much you really want to push away into a master page. And I believe MVC 4 has jQuery Mobile packed into it as a new template.

我强烈建议您创建一个用于构建移动页面的模板。我会尽快更新样本,如果这会有所帮助,它对我帮助很大,因为只有你真的想要推进到母版页中。而且我相信MVC 4将jQuery Mobile作为一个新模板打包进去。

  1. No, I would think it would be difficult to transition an asp.net web forms site to jQuery Mobile (think ViewState nightmares). Yes, it can be done but in my experience, asp.net web forms are bulky compared to their MVC counterparts when constructed properly - but again maybe thats biased on my poor experiences with HTML bloat caused by ASP controls and ViewState.

    不,我认为将asp.net Web表单站点转换为jQuery Mobile(想想ViewState噩梦)会很困难。是的,它可以完成,但根据我的经验,asp.net网络表单与MVC对应物相比构建正确时笨重 - 但也许这可能是因为我对ASP控件和ViewState引起的HTML膨胀的糟糕体验。

  2. You can manage data in several ways using a jQuery Mobile powered site. With MVC, we use traditional form elements where needed or post back through ajax when it makes sense. Remember you can always turn off the default ajax page loads/posts with the data-ajax="false" attribute or at the app level with ajaxEnabled option. Of course, something get stuck directly into Session as needed. Often times, a mobile site is more for consuming data than producing it. Based on that philosophy, I would think that its ok to use ajax and therefore MVC may be a better choice.

    您可以使用jQuery Mobile支持的站点以多种方式管理数据。使用MVC,我们在需要时使用传统的表单元素,或者在有意义的情况下通过ajax回发。请记住,您始终可以使用data-ajax =“false”属性关闭默认的ajax页面加载/帖子,或者使用ajaxEnabled选项关闭应用程序级别。当然,根据需要,某些东西会直接陷入Session。通常情况下,移动网站比生产网站更多地消耗数据。基于这种理念,我认为可以使用ajax,因此MVC可能是更好的选择。

Maybe its just my view of things because I've had the luxury (and testability) of working with MVC over the last few years... but yeah, in contrast it may be silly to use an asp.net web form app with your organizations jQuery Mobile site if you could instead use MVC.

也许这只是我对事物的看法,因为我在过去的几年中拥有与MVC合作的奢侈(和可测试性)......但是,相比之下,使用asp.net web表单应用程序可能很愚蠢组织jQuery Mobile网站,如果你可以改为使用MVC。

Hope this helps!

希望这可以帮助!