Link to home
Start Free TrialLog in
Avatar of welcome 123
welcome 123

asked on

Open dialog with server side controls in it

I need to open a dialog in the event of a button click or link, can be anything but not coming from a gridview and it should open up a ascx control which has a gridview in it which has events like delete, edit etc but no matter what I do i am getting the dialog closed in case of of any event fired in the gridview. help?

My dialog code:


        $(function SetupDialog() {
            $("#Detaildialog").dialog({
                modal: true,
                autoOpen: false,
                appendTo: aspnetForm,
                title: "Add a New Line Item",
                width: 850,
                height: 800
            });
            
            $("#btnAddLineDetail").click(function () {
                $('#Detaildialog').dialog('open');
            });
                    
        });


 <table>
        <tr >
              <td> <input type="button" id="btnAddLineDetail" value="Do not use this yet" visible="False" class="button" />
                </td>    
         </tr>
        <tr>
            
            <td>
                
                  <uc4:wuscSATransferDetail ID="wuscSATransferDetail" runat="server" />

            </td>

        </tr>
</table>

Open in new window


I also added the below in page load:
ScriptManager.RegisterStartupScript(Me, [GetType](), "SetupDialog", "SetupDialog();", True)
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of welcome 123
welcome 123

ASKER

I am not able to get it work. All I want is a click of a button or link which opens up a dialog in which it has a grid and save or delete or anything like post back to the server should not close the dialog. I am able to achieve this from the click even with a grid but not from a button separate.