(这是一个Q/A风格的问题,旨在成为那些提出类似问题的人的首选资源.很多人似乎偶然发现了这样做的最佳方式,因为他们不知道所有的选择许多答案都是ASP.NET特有的,但AJAX和其他技术确实在其他框架中具有等价物,例如socket.io和SignalR.)
我有一个我在ASP.NET中实现的数据表.我想实时或接近实时地显示页面上此基础数据的更改.我该怎么办呢?
我的型号:
public class BoardGame
{
public int Id { get; set;}
public string Name { get; set;}
public string Description { get; set;}
public int Quantity { get; set;}
public double Price { get; set;}
public BoardGame() { }
public BoardGame(int id, string name, string description, int quantity, double price)
{
Id=id;
Name=name;
Description=description;
Quantity=quantity;
Price=price;
}
}
Run Code Online (Sandbox Code Playgroud)
代替这个例子的实际数据库,我只是将数据存储在Application变量中.我将在我Application_Start的Global.asax.cs函数中播种它.
var SeedData = new List<BoardGame>(){
new BoardGame(1, "Monopoly","Make your opponents go bankrupt!", 76, 15),
new …Run Code Online (Sandbox Code Playgroud) 在ASP.NET应用程序中使用Ajax更新面板有哪些优缺点.有没有其他方法可以避免使用Ajax更新面板?