How to call javascript function from c#

前端 未结 7 1560
盖世英雄少女心
盖世英雄少女心 2020-12-11 19:18

I like to call a JavaScript function from c#. Can any one can give me code snippet.

More detail...

I have a asp.net page which has a asp button. when i click

7条回答
  •  眼角桃花
    2020-12-11 20:05

    You can't "call" a Javascript function from ASP.NET C# code-behind. You can write additional Javascript to the webpage. By the time the page is sent back to the user and the Javascript exists, your code-behind is gone. You can write out to a Literal or do a Response.Write()

    Response.Write("");
    

提交回复
热议问题