C#写ASP.NET的程序,用WEB 窗体的控件image,请问怎么让其加上链接? 也就是点击该image会产生一个链接,打开另一页面imagebutton控件倒是不错,就是不能加载圆形图片,image控件按下后又没有那种立体效果矛盾啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected void Page_Load(object sender, EventArgs e) { this.Image1.Attributes.Add("onclick", "window.location.href='webform1.aspx';"); } 前面加<a href="虚拟路径">,后面加</a> <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控件 写一个js代码函数来判断输入的是否是"123",然后this.button.Attributes.Add("onclick", "return js函数"); 我后来改用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中该怎么调用?初学者,请多指教! protected void Page_Load(object sender, EventArgs e) { this.Image1.Attributes.Add("onclick", "window.location.href='webform1.aspx';"); }--------------------------------------------------------------------同意上述方法 关于生成xml C#的线程处理 c# winform 窗体 多个按扭用一个事件 循环添加进Datatable 出现“该行已经属于此表” c#如何发送邮件 第一次做winform,问个初级问题 请问:如何取消子窗体显示时的动画效果? 怎样在给枚举项添加说明 帮我检查一下代码,为什么没更新数据库 怎样逆序输出字符串???? 关于DropDownList控件的问题.
{
this.Image1.Attributes.Add("onclick", "window.location.href='webform1.aspx';");
}
上面的HTML文本是用C#的HTML控件password field生成的,就是拿来输口令用的输入框,我现在
有个button,想按下的时候检查一下口令是否等于"1234",怎么做?因为我不知道在代码中怎么操作HTML控件
然后
this.button.Attributes.Add("onclick", "return js函数");
现在我写了一个最简单的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中该怎么调用?
初学者,请多指教!
{
this.Image1.Attributes.Add("onclick", "window.location.href='webform1.aspx';");
}
--------------------------------------------------------------------
同意上述方法