Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a grid with link button link1.

If i click on link1 another aspx page has to
get opened in the modal popup extender. I also need to pass value to the aspx page from the grid.

Can anyone help me with this. I tired the below code but nothing happens when i click the link button in grid.
ASP.NET
<asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup"  Width="600px" style="display:none;"> 
       <asp:Button id="btnShowPopup" runat="server" >
             <cc1:ModalPopupExtender ID="mdlPopup"  runat="server" DropShadow="true"
                  TargetControlID="panel2" PopupControlID="btnShowPopup"
                  CancelControlID="buttonClose"   PopupDragHandleControlID="panel2"  />

<asp:Panel ID="panel2" runat="server" Height="400px" Width="400px" > 
   <iframe id="Iframe1"  runat="server" width="800px" height="800px" src="LogAction.aspx" scrolling="auto" ></iframe></asp:Panel>
Posted
Updated 14-Apr-12 2:05am
v2
Comments
Nelek 14-Apr-12 8:05am    
Added tags

1 solution

Add the following javascript function to the onclick event from the linkbutton in the grid
eg
onclick="showModalPopup(); return false"

The "return false" allows the linkbutton not to post back


<script type="text/javascript">
function showModalPopup() {
            var modalPopupBehavior = $find('mdlPopup');
            modalPopupBehavior.show();
        }
</script>


[edit] pre tags added [/edit]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900