簡體   English   中英

使用 ajax 擴展時從 ASP.NET 調用 javascript

[英]calling javascript from ASP.NET when using ajax extention

好吧,我正在使用Visual Studio 2010

If I am not using Ajax ie if I am not using ScriptManager and UpdatePanel then it is simple task to call a JavaScript function from C# code behind event of any control using " ClientScript.RegisterStartupScript "

但是,如果我的C#代碼位於 UpdatePanel 內的控件后面,並且我們正在使用ScriptManager來使用Ajax ,應該怎么辦?

?!! 請指教

在按鈕的 onclick 事件上:

ScriptManager.RegisterStartupScript(this, this.GetType(), "alertJsTest", "alert('test!');", true);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM