首页 优化推广 aspx页面中写if else 语句的方法

aspx页面中写if else 语句的方法

来源: | 时间:2013/6/15 11:50:23 |

第一种方法: 在页面中引用<% %>此符号书写后台if else 语句

 <%
        string s = "1";
        if (s == "1")
        {
            Response.Write("<script> alert ('成功')</script>");

        }
        else
        {
            Response.Write("<script> alert ('失败')</script>");
        }
         %>


    第二种方法:需要在后台声明一个全局变量isok    

<%if (isok == "")
      {%>
          Response.Write("失败");
          <%} %>                                            
    <%else
        {%>
      Response.Write("失败");
      <%}%>

服务热线

153 8323 9821

功能和特性

价格和优惠

网站和维护

推广和优化

微信服务号