ASP.NET在*.aspx页面上如何写IF 判断语名。
请写个简单例子,本人是新手上路。谢谢

解决方案 »

  1.   

    js 和<#>一样
    i=="" ? "空" :"非空" 
      

  2.   

     <% string a = "zhangsan";
           if ("zhangsan".Equals(a))
               a = "";
             %>
      

  3.   

    是域名吧。
    那就通过request中的Request.Url.Host 可以获取当前域名。然后再根据 自己条件判断呗
      

  4.   


    <% int a = 1;
    int b = 2; 
          if (a<b)
     {
    Response.Write("<script>alert('正确!')</script>");
    }
              
            %>
      

  5.   

    <table><tr><td>
      <% if(a>0) //随便来的一个条件 %>我的帅哥
      <% else %> 我是大帅哥
    </td></tr></table>
      

  6.   

    <%
    if(MC=="1")
    {
    %>
    <table>
    <tr>
    <td>
    </td>
    </tr>
    </table>
    <%
    }
    else
    {
    %>
    <table>
    <tr>
    <td>
    </td>
    </tr>
    </table>
    <%
    }
    %>