I have a gridview
which contains a details button
as the last column.
My aspx:
<asp:GridView Width="100%" ID="gv_NotApplied" CssClass="datatable" AllowSorting="True"
runat="server" TabIndex="2" AutoGenerateColumns="False" AllowPaging="True" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="serial">
<ItemTemplate>
<asp:Label ID="lblSerial" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="name" DataField="crs_name" />
<asp:BoundField HeaderText="lecturer" DataField="name" />
<asp:TemplateField HeaderText="details">
<ItemTemplate>
<asp:ImageButton ID="Ibtn_Details" runat="server" ImageUrl="~/Images/detail.png"
CommandArgument='<%#((GridViewRow)Container).RowIndex%>' CommandName="Detail"
CausesValidation="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle VerticalAlign="Top" CssClass="row" />
</asp:GridView>
What I would like to do is:
When the user clicks the details button
, open a pop up window (dialog window).
In this window I would like to put some asp.net server controls in (like grid views). So I want this window to enable/allow me to access those controls in the code behind.
A small window that is displayed on top of the existing windows on screen. A popup window can be used in any application to display new information; however, the term often refers to an advertisement (see popup ad).
Step 1 : Start a new ASP.NET MVC Web application. Add a new controller called Home and in the Home controller, the Index method is available to you but there is not a view with it so add a view by right-clicking in Index action. Step 2 : In index. aspx add one HTML button to open our modal popup window like below.
Modal popup is a child window on the main window, that disables the main window functionality until the selection of a button in the child window. In a sample image given below, I have shown the modal popup window. Types of Modal Popups that can be created in ASP.NET.
Introduction. Popups are a commonly used rich interaction. By using a popup you can open a new layer above the current main page. If the popup is set as “Modal”, it also prevents any interaction with the rest of the web application.
I suggest that you open a modal pop up window like colorbox and this color box can point to show an aspx page that contain all the controls that you want. The color box will tell you how to make your button open the modal window and how to put in it the page.
For this kind of thing I love the following construct:
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel id="popup" visible="false" runat="server">
popup Content
</asp:Panel>
<asp:AlwaysVisibleControlExtender ID="AlwaysVisibleControlExtender1" TargetControlID="popup" runat="server" />
<asp:DragPanelExtender ID="DragPanelExtender1" TargetControlID="popup" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
popup.visible = true;
when you need the popup and have full control over its contents. Updatepanel + Ajax Control
Toolkit Extender will give it the look and feel of an independant popup, though.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With