也就是点击该image会产生一个链接,打开另一页面
imagebutton控件倒是不错,就是不能加载圆形图片,image控件按下后又没有那种立体效果
矛盾啊

解决方案 »

  1.   

    protected void Page_Load(object sender, EventArgs e)
        {
            this.Image1.Attributes.Add("onclick", "window.location.href='webform1.aspx';");
                }
      

  2.   

    前面加<a href="虚拟路径">,后面加</a>
      

  3.   

    <INPUT style="Z-INDEX: 104; LEFT: 360px; WIDTH: 152px; POSITION: absolute; TOP: 136px; HEIGHT: 24px"type="password" size="20">
    上面的HTML文本是用C#的HTML控件password field生成的,就是拿来输口令用的输入框,我现在
    有个button,想按下的时候检查一下口令是否等于"1234",怎么做?因为我不知道在代码中怎么操作HTML控件
      

  4.   

    写一个js代码函数来判断输入的是否是"123",
    然后
    this.button.Attributes.Add("onclick", "return js函数");
      

  5.   

    我后来改用imagebutton来做了,这是一个Web窗体的控件
    现在我写了一个最简单的javascript,想按下imagebutton来调用
    <script language="javascript">
    function IsRightUser(user,pwd)
    {
     var s_user="test";
     var s_pwd="1234";
       
       if (user=s_user and pwd=s_pwd)
       {
         document.all["lab"].value = "ok";
        }
    }
    </script>lab是HTML的组件LABEL,我在HTML的脚本里加了name:
    <DIV style="DISPLAY: inline; Z-INDEX: 106; LEFT: 224px; WIDTH: 160px; POSITION: absolute; TOP: 296px; HEIGHT: 24px"ms_positioning="FlowLayout"name="lab">Label</DIV>
    不过好象会出错然后在imagebutton中的onclick中该怎么调用?
    初学者,请多指教!
      

  6.   

    protected void Page_Load(object sender, EventArgs e)
        {
            this.Image1.Attributes.Add("onclick", "window.location.href='webform1.aspx';");
        }
    --------------------------------------------------------------------
    同意上述方法