【发布时间】:2020-09-02 17:27:15
【问题描述】:
我有这个:想法是将数据从后面的代码传递给客户端,我无法捕获客户端中的信息这是问题
string name="Juan Pérez";
string date = "06/07/2020";
string num1 = "2020-00001";
string num2 = "2020-0022";
ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "mensajeRecibo("+date+","+ num1+","+name+","+num2+");", true);
【问题讨论】:
-
so... 1)“传递给客户”到底是什么意思? 2)你的问题到底是什么,你有什么问题?
-
我需要从代码后面传递数据,数据是以模态显示的
function mensajeRecibo(fecha, numvisado, nombre, minuta) { document.getElementById('fechaImpresion').value = nombre; document.getElementById('Label1').value = nombre; document.getElementById('Label2').value = nombre; document.getElementById('Label3').value = nombre document.querySelector('.bg-modal').style.display = "flex"; } -
请在 cmets 中不发布代码,它几乎不可读。 编辑 你的问题。仍然:你有什么问题?
-
您是否尝试将信息从服务器端代码 (C#) 传递到客户端代码 (HTML)?您可以只注册一个从服务器端查看的隐藏占位符并将值放入这些对象中。
-
查看this答案