使用JS和Ajax与ASP.NET一样使用MVC [英] Using JS and Ajax with ASP.NET like MVC

查看:54
本文介绍了使用JS和Ajax与ASP.NET一样使用MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我是一名初级程序员,到目前为止我只使用Android和MVC。在工作中,使用MVC,我使用JS和Ajax与服务器进行通信。我现在必须为大学制作一个项目,但我不能使用MVC,只能使用ASP.NET。我搜索过,我发现的所有例子都是使用服务器控件和JS验证,但这不是我想要的。我想只为客户端使用HTML / JS / CSS并使用Ajax。我需要以这种方式工作的设置(文件夹,文件和参考)是什么?我正在使用VS 2013.

谢谢!!

Hi. I'm a junior programmer and so far I've only worked with Android and MVC. At work, with MVC, I use JS and Ajax to communicate with the server. I have to make a project for the university now but I can't use MVC, only ASP.NET. I've searched and all the examples I found is something like using server controls and JS validation but that's not what I'm looking for. I want to use only HTML/JS/CSS for the client side and use Ajax. What's the setup (folders, files and references) I need to work that way? I'm using VS 2013.
Thank you!!

推荐答案

您的请求是模糊的,以提出一个真正的问题。除了您对技术和架构的熟悉之外,您没有提出任何真正的问题。由于没有奇迹这样的东西,没有人可以在一个快速答案中给你所有这些知识(顺便说一下,这个论坛被称为快速问题和答案)。所以,我可以说的是,如果您可以访问ASP.NET(适当的托管),那么您列出的所有技术都是可用的,这已经足够了。



至于MVC,我不知道为什么你说你不能使用它,但你可以做的是:



首先,你需要意识到有这个术语至少有两种不同的含义:

Your request is way to vague to make a real question. You did not formulate any real problem except you pure familiarity with technology and architecture. As there is no such thing as miracle, nobody can give you all this knowledge in one Quick Answer (this forum is called Quick Questions & Answers, by the way). So, all I can say is that all technologies you listed are always available if you have access to ASP.NET (appropriate hosting), and it is quite enough.

As to MVC, I have no idea why do you say you cannot use it, but there is what you can do:

First, you need to realize that there are at least two different sense of this term:
  1. 建筑模式 http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller [ ^ ]
  2. 基于ASP.NET实现此模式的框架: http://www.asp.net/mvc [ ^ ]。
  1. Architectural pattern: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller[^]
  2. Framework based on ASP.NET implementing this pattern: http://www.asp.net/mvc[^].





在下一步中,您需要在第二个意义上认识到MVC是基于ASP.NET和您列出的技术实现的,没有别的。这意味着您拥有与此框架的创建者相同的机会。换句话说,您需要的只是第一种意义上的学习MVC,作为架构,并使用您列出的技术实现它。



结论:使用上面引用的文章和ASP.NET,.NET,Javascript,HTML,HTTP,CSS和原始文档与它相关的一切,以及一般编程。没有进一步的指导可以取代这种学习你有你需要开始的一切。



-SA



In your next step, you need to realize that MVC in the second sense of this term is implemented based on ASP.NET and the technologies you listed, nothing else. It means that you have the same opportunities as the creators of this framework. In other words, all you need is the learn MVC in the first sense, as the architecture, and implement it using the technologies you listed.

Conclusion: use the article referenced above and the original documentation on ASP.NET, .NET, Javascript, HTML, HTTP, CSS and everything related to it, as well as general programming. No further instruction can substitute this learning. You have everything you need to start.

—SA


你应该使用ASP.NET MVC是ASP.NET的扩展。



我有一系列关于这个主题的4篇文章,这是第一篇,它也解释了ASP.NET MVC项目: MVC基本站点:第1步 - 多语言站点骨架 [ ^ ]



在ASP.NET MVC应用程序中使用AJAX是通过使用我系列的第4篇文章中的示例来解释的:MVC基本站点:第4步 - 使用AJAX,JSON,jQuery,LINQ在MVC 4.0中进行jqGrid集成和序列化 [ ^ ]
You should used ASP.NET MVC that is an extension of the ASP.NET.

I have a series of 4 articles about this subject and this is the first one and it explains also the structures of the ASP.NET MVC projects: MVC Basic Site: Step 1 – Multilingual Site Skeleton[^]

The using of AJAX in ASP.NET MVC application is explained by using examples in the 4th article from my series: MVC Basic Site: Step 4 – jqGrid Integration in MVC 4.0 using AJAX, JSON, jQuery, LINQ, and Serialization[^]


我结束了使用这个

从ASP NET中的JavaScript调用服务器端功能


这篇关于使用JS和Ajax与ASP.NET一样使用MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆