如何使用ajax jqurey从db获取数据 [英] How to get data from db with ajax jqurey

查看:81
本文介绍了如何使用ajax jqurey从db获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Ajax jqury从db获取数据以及如何使用c#web方法自动创建HTML



我尝试过:



从简单的ajax获取并显示来自数据库的数据

How to get data from db with Ajax jqury and how to create HTML automatically in c# web method

What I have tried:

get and show data from db with simple ajax

推荐答案

你的问题太宽泛了,可以你可能没有回答,因为你没有说过你正在使用什么服务器技术或者你正在使用什么数据库访问。以下是使用webforms和ado的链接,以及使用mvc和Entity Framework的链接。你可以更好地阅读一本书或者开始学习你所选择的技术,你不能从论坛帖子中学到一些东西。



Asp.net ajax JSON示例,C#WebMethod with sql database - Codepedia.info [ ^ ]



jQuery Ajax对MVC中Controller方法的GET和POST调用 [ ^ ]
Your question is far too broad and can't possibly be answered as you haven't said what server technology you are using or what database access you are using. Below are links that use webforms and ado, and one that uses mvc and Entity Framework. You're far better going through a book or getting started tutorials on your chosen technology, you can't learn something from scratch from a forum post.

Asp.net ajax JSON Example, C# WebMethod with sql database - Codepedia.info[^]

jQuery Ajax GET and POST calls to Controller's Method in MVC[^]


试试这个样本

别忘了导入jquery库。



脚本:

Try this sample
dont forgot to import the jquery library.

Script:
<script>


function (){
GetDataFromAjax( hello世界);
});

function GetDataFromAjax(header){
(function () { GetDataFromAjax("hello world"); }); function GetDataFromAjax(header) {


这篇关于如何使用ajax jqurey从db获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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