在asp.net mvc中创建“可插入”应用程序(Creating “pluggable” apps in asp.net mvc)
我一直在使用asp.net MVC,但仍然不是很擅长。 但是,我开始想知道如何创建可以“插入”或以最小复杂度安装到现有ASP.net MVC站点的应用程序。
例如,在ASP.net Web表单中,我开发了一种Blogging应用程序。 为了安装这个应用程序,我只需要将一个DLL放入Bin文件夹,添加一些web.config行,然后根据需要将控件添加到aspx页面。 不需要做其他改变。
现在我正在使用MVC,并且我遇到了部分视图,它们似乎以某种方式取代了webform usercontrols。 但是,看起来您仍然需要从控制器传递部分视图的数据,并且这个数据的级别高于页面。 我必须修改控制器代码才能安装应用程序。
我很确定我正在用错误的思维思考这个问题。 有没有办法为asp.net mvc创建可轻松插入现有网站的应用程序?
I've been working with asp.net MVC and am still not very good at it. However, I have started wondering how would I go about creating applications that can be "plugged" or installed into an existing ASP.net MVC site with minimal complexity.
For example, in ASP.net web forms I developed a sort of Blogging app. In order to install this app I just need to drop a dll into the Bin folder, add a few web.config lines and then add controls to the aspx pages as needed. No other change needs to be made.
Now I'm working with MVC and I've come across partial views which seem to replace webform usercontrols in some way. However, it seems you still need to pass the partial view's data from the controller and that is at a higher level than the page. I'd have to modify controller code to install an app.
I'm pretty sure I am thinking about this with the wrong mindset. Is there a way to create applications for asp.net mvc that can be easily plugged into an existing web site?
原文:https://stackoverflow.com/questions/879825
最满意答案
假设您在
nl2br()
调用后发布的列表实际上采用以下格式United Kingdom<br /> United States of America<br /> Abkhazia<br /> ...
你可以做
<?PHP explode("<br />", $yourString); // or explode("\n", $yourString); if you remove the nl2br() call ?>
Assuming the list you posted is actually in the following format after your
nl2br()
callUnited Kingdom<br /> United States of America<br /> Abkhazia<br /> ...
You can do
<?PHP explode("<br />", $yourString); // or explode("\n", $yourString); if you remove the nl2br() call ?>
相关问答
更多-
你可以用这个来管理: list.collect(&:values).flatten You might manage with this: list.collect(&:values).flatten
-
你应该看看get_object_vars ,因为你的属性被声明为private,你应该在类中调用它并返回其结果。 小心,对于原始数据类型,如字符串,它会很好的工作,但我不知道它是如何与嵌套的对象。 在你的情况下,你必须做一些类似的事情; response->docs)); ?> You should look at get_object_vars , as your properties are declared pr ...
-
你可以这样做, var res = [], tmp = {}, obj = {}; x.forEach(function(itm,i) { if(itm[0] !== "F"){ tmp[itm[0]] = itm[1]; } else { obj["profile_" + itm[1]] = tmp; res.push(obj); tmp = {}, obj ={}; } }); 其中x是包含data的array 。 You can do it by, var res = [ ...
-
你可以简单地做: disciplines.map{ |k, v| { 'name' => k, 'value' => v } } 实现这一目标。 这是一个演示: http : //ideone.com/DBU3Ck You can simply do: disciplines.map{ |k, v| { 'name' => k, 'value' => v } } to achieve that. Here's a demo: http://ideone.com/DBU3Ck
-
假设您在nl2br()调用后发布的列表实际上采用以下格式 United Kingdom
United States of America
Abkhazia
... 你可以做 ", $yourString); // or explode("\n", $yourString); if you remove the nl2br() call ?> Assuming the list you posted is act ... -
class Item def ingredients_a ingredients.gsub(/(\[\"|\"\])/, '').split('", "') end end 剥去无关字符 使用分离模式分割为数组元素 class Item def ingredients_a ingredients.gsub(/(\[\"|\"\])/, '').split('", "') end end strip off the extraneous characters split i ...
-
telerik组合支持绑定到WCF服务 - 我挖出了这个实时样本 ,这可能是你的案例的良好开端。 The telerik combo supports binding to WCF service - I dug up this live sample, probably a good start for your case.
-
在列表对象上调用ToArray()方法。 我提供了文档的链接。 本文档引用System.Collections.Generic命名空间,该命名空间在所有.NET版本中都可用,与更专业的linq命名空间不同。 它们确实执行相同的功能,但是这里没有提供有关性能比较的详细信息。 关于List.ToArray方法的MSDN文档 命名空间:System.Collections.Generic 汇编:mscorlib(在mscorlib.dll中) public T [] ToArray() Call the ToAr ...
-
这里的问题是ARRAYFORMULA不能与AVERAGE一起使用。 但你总是可以使用javascript。 打开脚本编辑器并粘贴此代码。 function avg(nums, d) { var r = [], i, j, start, end, avg, count; for(i = 0; i < nums.length; i++) { if(d <= i) r.push([""]); else { if(i < 10) start = 0; el ...
-
由于请求必须是PUT请求,请删除 curl_setopt($ch, CURLOPT_POST, true); 并使用 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); Since the request must be a PUT request, remove curl_setopt($ch, CURLOPT_POST, true); and use curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");