简体   繁体   English

JavaScript,asp.net和Sql Server

[英]JavaScript, asp.net and Sql Server

I know how to use client side JavaScript with asp.net script. 我知道如何将客户端JavaScript与asp.net脚本一起使用。 But I am unable to figure out how to retrieve data from database and show that data with JavaScript in an asp.net page. 但是我无法弄清楚如何从数据库中检索数据并在asp.net页中使用JavaScript显示该数据。

Suppose I have written a JavaScript Grid. 假设我已经编写了一个JavaScript网格。 Then how can I fill that grid with data from SQL Server and show that grid on an asp.net page? 然后,如何用来自SQL Server的数据填充该网格并在asp.net页上显示该网格?

That is, how to connect C# and JavaScript on the server side? 也就是说,如何在服务器端连接C#和JavaScript?

I would be grateful if you provide me with an web-link of an example. 如果您向我提供示例的网络链接,将不胜感激。

Hope I am able to articulate my question. 希望我能阐明我的问题。

how to connect C# and JavaScript on the server side 如何在服务器端连接C#和JavaScript

You can use AJAX for this. 您可以为此使用AJAX It can issue a request to the server and after completion of the request response can be read in JavaScript in many formats like HTML, XML , JSON . 它可以向服务器发出请求,完成请求后,可以用JavaScript读取HTML,XMLJSON等多种格式的响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM