asp.net 如何用js在母模版 获取 子页 的控件ID 。 例:在一个子页面的GridView上点一个“提交”时,怎么获取这个GridView的ID?asp.netjs控件ID操作
解决方案 »
- <object>怎么接受onclick事件
- 看看这个错误、、急急急!!!
- jquery 获 span值的问题
- 大家帮忙想些适合网页能做的工具
- 求解关于使用JS进行重定向的问题
- 下拉框点击事件后把隐藏的多种框显示出来(包括不在同行的下拉框,文本框)
- 怎样能让一个提交按钮以两种不同的颜色交替出现,实现闪烁效果
- 怎样用js还原窗口?
- 求教下!无数个</li></li> 1-5用jq增加个<ul></ul>包起来 第5-12个再ul包 12-21继续ul包.。。。这种如何实现?
- jquery中这种写法疑似木有
- 可以显示当前城市 但是显示不出公交路径 求查看哪里错误 刷分的勿进 非常急 跪求了
- 将div内容显示到另一个div的iframe里
但加上了母版页,或者有其它变动, this.控件ID.ClientID ,
下面的代码是示意<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
var gvId = "<%=this.GridView1.ClientID %>";
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
var gd=$("#"+idPrefix+"gdName");<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
肯定在子页上操作呀。再说你知道这个子页的id获取到了,其它子页如果出现相同的id呢?