如何从数据库中检索html代码或c#代码使用json,jquery?

问题描述:

我想让像blogproject这样的博客网站,但我不知道如何在代码中复制代码,因为它是粘贴在文本框中并将该代码保存在数据库中并按原样进行检索。并且该代码可能是c#,html代码,我想使用jquery json。谁能告诉我?

I want to make blog site like codeproject but i don't know how to retrive code as it is paste in textbox and save that code in database and retrive as it is. and that code may be c#, html code and i want to use jquery json. anyone can tell me?

您将在html中构建一个用户界面,然后使用某种服务(REST或SOAP)将来自该网站的数据存储到数据库中。



在Microsoft世界中,REST服务可以是WebAPI或MVC控制器。两者都提供了保存到数据库中的选项。



ASP.Net MVC

使用MVC进行ASP.NET应用程序开发 [ ^ ]

使用jQuery初学者的ASP.NET MVC3 Razor [ ^ ] br />


Web API

在ASP.NET Web API 1中启用CRUD操作 [ ^ ]

使用Web API将ASP.Net表单数据插入数据库 [ ^ ]
You will build a user interface in html and then store data from this website into the database using some sort of service (REST or SOAP).

In the Microsoft world, REST service can be a WebAPI or an MVC controller. Both provide options to save into the database.

ASP.Net MVC
ASP.NET Application Development Using MVC[^]
ASP.NET MVC3 Razor With jQuery For Beginners[^]

Web API
Enabling CRUD Operations in ASP.NET Web API 1[^]
Inserting ASP.Net Form Data Into Database Using Web API[^]


请参阅CP上的这篇文章

使用RESTful WCF服务和JavaScript实现CRUD操作 [ ^ ]



本文介绍通过JQuery使用WCF REST服务并执行的简便方法CRUD(创建检索更新删除)操作



您还可以下载示例代码provi ded并亲自尝试。
Please refer to this article on CP
Implement CRUD Operations using RESTful WCF Service and JavaScript[^]

This article explains easy ways to consume WCF REST services through JQuery and perform CRUD (Create Retrieve Update Delete) operations

You can also download the sample code provided and try it out yourself.