The name 'ClientScript' does not exist in the current context

后端 未结 3 1464
攒了一身酷
攒了一身酷 2020-12-31 01:39

I have a behindcode javascript. it is to show a javascript dialog box.

however, it keep show this error

The name \'ClientScript\' does not exist in         


        
3条回答
  •  萌比男神i
    2020-12-31 01:43

    For cs file the sample is;

    ClientScript.RegisterClientScriptBlock(this.GetType(), "{some text for type}", "alert('{Text come to here}'); ", true);
    

    for masterpage cs the sample is;

    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "{some text for type}", "alert('{Text come to here}'); ", true);
    

提交回复
热议问题