一般的な処理プログラム(asx)でjsメッセージを表示します.

1063 ワード

   form   ,     $("form").submit()       ,          ,           ,     ,         
  public class Script
        {
            public static void Alert(string message)
            {
                ResponseScript("alert('" + message + "');window.location = '      ,            ';");
            }
            public static void ResponseScript(string script)
            {
                HttpContext.Current.Response.Write("
//<![CDATA[
"); HttpContext.Current.Response.Write(script); HttpContext.Current.Response.Write("
//]]>

"); } }
  
               //context.Response.ContentType = "text/plain";  
            context.Response.ContentType = "text/html";
  
         :

Script.Alert("     !");
  
転載先:https://www.cnblogs.com/hbh123/p/6218671.html