Pass parameter to Javascript function from ASP code behind

后端 未结 1 1218
长发绾君心
长发绾君心 2021-02-10 18:53

I have a long process and I want to show a user a progress bar where I pass a parameter (percentage) to a Javascript function in my Webform with masterpage.

I have this:

1条回答
  •  逝去的感伤
    2021-02-10 19:18

    Try this way

        string updateProgress = "18%";
        ClientScript.RegisterStartupScript(this.GetType(), "updateProgress", "updateProgress('" + updateProgress + "');", true);
    

    Script AS

       
    

    ASPX page

       

    0 讨论(0)
提交回复
热议问题