ModalPopupExtender 传参给弹出窗口
(ModalPopupExtenderAJAX.net)如何传参给弹出窗口,使得GRIDVIEW1根据传来的参数显示相应相据我的问题是怎么传值啊,我知道那个东西怎么用。你...
(ModalPopupExtender AJAX.net)如何传参给弹出窗口,使得GRIDVIEW1根据传来的参数显示相应相据
我的问题是怎么传值 啊,我知道那个东西怎么用。你这里没有提到传值问题,你放在网页上试下你就懂我问的是什么了。不要只是想理所当然````` 展开
我的问题是怎么传值 啊,我知道那个东西怎么用。你这里没有提到传值问题,你放在网页上试下你就懂我问的是什么了。不要只是想理所当然````` 展开
展开全部
这个意思吗?
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("C1");
dt.Columns.Add("C2");
DataRow dr = dt.NewRow();
dr[0] = "12345";
dr[1] = "67890";
dt.Rows.Add(dr);
DataRow dr2 = dt.NewRow();
dr2[0] = "ABCDE";
dr2[1] = "FGHIJ";
dt.Rows.Add(dr2);
GridView1.DataSource = dt;
GridView1.DataBind();
}
<body>
<script language="javascript" type="text/javascript">
function Button1_Click()
{
var senderId = event.srcElement.id;//IE下
var label1 = senderId.replace('Button1','Label1');
var label2 = senderId.replace('Button1','Label2');
$get('Label3').innerHTML = $get(label1).innerHTML;
$get('Label4').innerHTML = $get(label2).innerHTML;
}
</script>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Panel ID="Panel1" runat="server" Width="200" Height="100" BackColor="Gray">
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
<br />
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" />
</asp:Panel>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("C1") %>'></asp:Label>
<br />
<asp:Label ID="Label2" runat="server" Text='<%# Eval("C2") %>'></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Button1_Click()" />
<cc1:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" Enabled="True"
CancelControlID="Button2" PopupControlID="Panel1" TargetControlID="Button1">
</cc1:ModalPopupExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("C1");
dt.Columns.Add("C2");
DataRow dr = dt.NewRow();
dr[0] = "12345";
dr[1] = "67890";
dt.Rows.Add(dr);
DataRow dr2 = dt.NewRow();
dr2[0] = "ABCDE";
dr2[1] = "FGHIJ";
dt.Rows.Add(dr2);
GridView1.DataSource = dt;
GridView1.DataBind();
}
<body>
<script language="javascript" type="text/javascript">
function Button1_Click()
{
var senderId = event.srcElement.id;//IE下
var label1 = senderId.replace('Button1','Label1');
var label2 = senderId.replace('Button1','Label2');
$get('Label3').innerHTML = $get(label1).innerHTML;
$get('Label4').innerHTML = $get(label2).innerHTML;
}
</script>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Panel ID="Panel1" runat="server" Width="200" Height="100" BackColor="Gray">
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
<br />
<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" />
</asp:Panel>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("C1") %>'></asp:Label>
<br />
<asp:Label ID="Label2" runat="server" Text='<%# Eval("C2") %>'></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Button1_Click()" />
<cc1:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" Enabled="True"
CancelControlID="Button2" PopupControlID="Panel1" TargetControlID="Button1">
</cc1:ModalPopupExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询