从jquey获取gridview的Button ID [英] Getting Button id of gridview from jquey

查看:64
本文介绍了从jquey获取gridview的Button ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在网格视图内,我有3个按钮(a,b,c).在单击每个按钮时,必须出现一个模式弹出窗口,以供用户确认.

为此,我尝试使用Ajax工具包

Hi,

inside a grid view i have 3 buttons (a,b,c). On click of each buttons a modal popup must appear for getting user confirmation.

For this i tried using Ajax toolkit

ModalPopupExtender

,但这会在页面加载本身中询问

but this asks

TargetControlID

.

现在我正在尝试使用jQuery.这里的问题是没有获取语法来获取gridview内该按钮的客户端ID.
请帮我解决这个问题.

在此先感谢

in page load itself.

Now i am trying with jquery. here problem is not getting syntax to get client id of this button inside gridview.
Please help me solve this.

thanks in advance

推荐答案


使用AJAX检查此示例
将Css添加到Grid,它将为您提供所需的示例,例如
Hi ,
Check this Example with AJAX
Add Css to Grid and it will give you what you need like this Example
<style type="text/css">
.modalBackground

{
      background-color:Gray;
      filter:alpha(opacity=70);
      opacity:0.7;
}
.ModalWindow
{

  border: solid1px#c0c0c0;
  background:#f0f0f0;
  padding: 0px10px10px10px;
  position:absolute;
  top:-1000px;
}

    </style>





<div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:DropDownList ID="DropDownList1" runat="server">
    </asp:DropDownList>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Button ID="Button2" runat="server" Text="Button" />
                    <asp:ModalPopupExtender ID="Button2_ModalPopupExtender" runat="server" PopupControlID="Panel1" BackgroundCssClass="modalBackground"
                        DynamicServicePath="" Enabled="True" TargetControlID="Button2" CancelControlID="Button3">
                    </asp:ModalPopupExtender>
                    <asp:Panel ID="Panel1" runat="server" CssClass="ModalWindow">
                    Test
                    1
                  2
                        <asp:Button ID="Button3" runat="server" Text="Close" />
                    </asp:Panel>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField></asp:TemplateField>
        </Columns>
    </asp:GridView>

</div>


最好的问候
米特瓦里(M.Mitwalli)


Best Regards
M.Mitwalli


这篇关于从jquey获取gridview的Button ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆