javascript 要如何获取DataList模版列中的值??
代码:
<asp:DataList ID="DataList1" runat="server">
<ItemTemplate>
<a onclick="[color=#FF0000]f()">[/color]
<asp:Label ID="Label1" runat="server" Text=' <%# Eval("xxx") %>'> </asp:Label>
</a>
</ItemTemplate>
</asp:DataList>
------------------------------
我这么写是想对DataList 的项 添加单击事件。
可是我这么写了后,在脚本中 f() 方法里 又要如何获取到 被单击项 中 Label 控件中的 Text值呢?? 请麻烦给个 f() 的示例代码
<script>
function GetValue() {
alert(document.getElementById("Label1").innerHTML);
}
</script>
<asp:Label runat="server" Text="122222222" ID="Label1"/>
<input onclick="GetValue()" type="button" />
貌似asp:Label 没有onclick事件....
JScript code
Code highlighting produced by Actipro CodeHighligh
相关问答:
这是我的文本框
<input type="text" size="60" name="password_answer" id="pwdanswer" value="$!password_answer" >
提交按钮
<input clas ......
后台有一个函数 protected string Fun1(int a, string b)
我想在javascript代码中调用它,怎么做?
function GridBind()
{
var a = 1;
var b='s';
& ......
如何实现当鼠标悬停控件上时,出现该控件的尾部显示对应的层,鼠标移动到该层上进行相应的操作,当鼠标移除时(不在控件上也不在层上)层隐藏,
HTML code:
<html>
<head>
<meta http-equiv= ......
后台:
protected void form_ini2(string id)
{
//处理代码
}
前台:
<script language="javascript">
function DbClickEvent(a ......
手头有一个网站,完全是用javascript和html写的,只有一个 default.html页面,然后左侧有下拉菜单,中间显示内容,现在的问题是希望在news菜单点击后显示的东西能够分页,但是分页技术是要改变url的,这样的话整个页 ......