当前位置:编程学习 > C#/ASP.NET >>

小白问题!在线急求

实现这样一个功能,点击图片,判断是否登录,登录跳转到功能功能页,否则跳转到登录页。
  我想这样写   if(session["username"]=="游客")
                 {

                       response.redirect(“”);
                   }
               else
                          response.redirect(“”);

重点是我拖用的image控件,怎么实现图片点击这个方法啊??像onclick。。。。。是在白痴的问题。。。。求教了 --------------------编程问答-------------------- 用ImageButton --------------------编程问答-------------------- ImageButton , 设置图片为背景等办法 --------------------编程问答-------------------- 直接跳转到功能页. 你的功能页肯定有判断: 如果没登录就跳转到登录页的吧. --------------------编程问答-------------------- --------------------编程问答-------------------- 对啊  ImageButton实现不了吗? --------------------编程问答-------------------- 可是怎么处理imagebutton的点击方法啊?

在cs里写imagebutton.onclick写不出onclick方法啊? --------------------编程问答-------------------- ImageButton,正解 --------------------编程问答-------------------- 确实是ImageButton
--------------------编程问答-------------------- ...双击ImageButton按钮,会自动添加click事件 --------------------编程问答-------------------- 就是ImageButton 。
触发点击事件 后台方法里面放你的判断代码 。 --------------------编程问答-------------------- 兰州烧饼,哈哈 --------------------编程问答-------------------- 双击控件就有事件了。 --------------------编程问答-------------------- 实在不行自己写一个也行啊,lz建的是网站应用程序吧,要有design。cs才能双击产生button事件 --------------------编程问答--------------------
引用 6 楼 z631373000 的回复:
可是怎么处理imagebutton的点击方法啊?

在cs里写imagebutton.onclick写不出onclick方法啊?

protected void Page_Load(object sender, EventArgs e)
    {
        ImageButton1.Click += new ImageClickEventHandler(ImageButton1_Click);
    }

    void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        
    } --------------------编程问答-------------------- --------------------编程问答-------------------- 兰州烧饼 --------------------编程问答--------------------                             兰州烧饼 --------------------编程问答-------------------- imagebutton --------------------编程问答-------------------- imagebutton 
简单明了!
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,