我想RegisterClientScriptBlock在一個只能通過AJAX調用調用的方法。它似乎沒有實際註冊頁面上的腳本,我猜這是因爲它實際上並沒有重新加載整個頁面。有沒有辦法在ajax方法調用的頁面上註冊javascript?RegisterClientScriptBlock在AJAX方法調用
protected void MyMethod(object sender, EventArgs e)
{
// This method only called via AJAX call
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "resize", "alert('here');", true);
}