开发者

PopUp in GridView

I need to open a pop up window when clicking a link in a grid view column. Can any one help me out?

i ahve a grid like this..

Id Name o/p status details

1 xxx 78.9% p viewdetails ----------- 2 yyy 65% p viewdetails ------------

wat i need is , if i click the view details link from 开发者_JAVA百科the grid, it should pop up the in put details of the corresponding output in a grid inside a pop up.


take a look at jquery and in particular the jqueryui.

the jqueryui has a great popup which does modal and everything.

http://jqueryui.com/demos/

and

http://jqueryui.com/demos/dialog/


There are several jQuery plugins available to create dialogs very easily. One such plugin is jQuery Colorbox.

http://colorpowered.com/colorbox/

It is very easy to integrate and comes with several options to create dialogs.

For example :

$(document).ready(function () {    
      $(".cboxdemo").colorbox({ width: "80%", height: "80%", iframe: true });    
});

This code would show a popup on click of all hyperlink elements having class "cboxdemo". Content pointed by href attribute will be displayed in the dialog box.


I think you need ASP.NET AJAX Control Toolkit. Try ModalPopup

UPD: something like this:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
    <Columns>

        <asp:ButtonField ButtonType="Link" Text="Show popup" />               
    </Columns>
</asp:GridView>
<asp:Panel ID="Panel1" runat="server" BackColor="White" BorderColor="#43AAE4"
    BorderStyle="Solid" BorderWidth="2px">            
        <div style="text-align: right; width: 100%">
        Some text in popup
    </div>   
</asp:Panel>
<cc1:ModalPopupExtender ID="modalPopupExtender" runat="server" PopupControlID="Panel1"
    TargetControlID="LinkButton2" DropShadow="true">
</cc1:ModalPopupExtender>  
<asp:LinkButton ID="LinkButton2" runat="server" Text=""></asp:LinkButton>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜