我想在单击链接按钮时显示弹出窗口
问题描述:
大家好,
我在页面加载中显示的网格视图中有一些列.在所有记录的最后一列中,我有一个名为详细信息的链接按钮.如果单击详细信息链接按钮,我想在弹出窗口中显示详细信息. br/>
请在这方面帮助我.
在此先感谢.
Hi All,
I am having grid view displayed in page load having some columns.In the last column of all the records i am having one link button called detail.If i click the details link button i want to display the details in the pop up window.
Please help me in this regard.
Thanks in Advance.
答
u可以在javascript中为此使用showModalDialog().
在gridview rowdatabound事件中找到您的编辑控件,然后从ID为参数的javascript函数中调用javascript函数.
搜索showModalDialog(),您将获得所有详细信息.
u can use showModalDialog() for this in javascript.
Find your edit control in gridview rowdatabound event and call javascript function from that with ID as parameter.
Search for showModalDialog() and u will get all details.
请参阅以下链接,它给您一个主意.
gridview中的弹出窗口扩展器 [使用Ajax弹出窗口在GridView中显示扩展详细信息 [
See the following links, it gives you an idea.
Popup extender in gridview[^]
Displaying Extended Details in a GridView Using an Ajax Pop-Up[^]
您可以像这样使用
You can use like this
<asp:DataGrid ID="DataGrid1" runat="server" Width="90%" AutoGenerateColumns="False"
ShowHeader="False">
<ItemStyle BackColor="DarkCyan"></ItemStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<a href="#"><%# Eval("gender")%></a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="total" HeaderText="Total">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
</Columns>
</asp:DataGrid>
您可以添加您的链接.
您必须添加一个弹出JavaScript文件并更改href值.
示例:弹出示例 [
And you can add Your Link.
You have to add a popup javascript file and chang the href value.
Examples : Popup Examples[^]
Thanks