更新时间:2023-12-05 23:16:28
您需要通过真正
作为最后一个参数的的RegisterClientScriptBlock()为了让您的客户端code被包裹在一个 <脚本>
元素:
You need to pass true
as the last argument to RegisterClientScriptBlock() in order for your client-side code to be wrapped in a <script>
element:
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(GetType(), "Email",
"GetEmail();", true);
}