0

I have a drop down and it has 5 items . I need to show sharepoint modal popup based on the dropdown selected item on button click.

    <asp:DropDownListID="ddl1"runat="server"OnSelectedIndexChanged="ddl1_SelectedIndexChanged" AutoPostBack="true">
    <asp:ListItem>      SELECT     </asp:ListItem>
     <asp:ListItem>G P(No Contract Required)</asp:ListItem> 
     <asp:ListItem>NO Ct</asp:ListItem>
     <asp:ListItem>CONT</asp:ListItem>
     <asp:ListItem>TRA</asp:ListItem>
     <asp:ListItem>V-CON</asp:ListItem>
 <asp:linkButton ID="lnk" runat="server" Text="Add New Item" Font-Underline="false" >  </asp:linkButton> 

If select item is "CONT" then need to show sharepoint modal popup of one page ex:https://www.google.com else show the popup of the following url ex://https://www.gmail.com

on button click

can anyone help me on this

0

You should call function OpenModalDialogTest() on your button click that would handle what item selected in dropdown like:

function OpenModalDialogTest(){
    $('select#yourId').change( function() {
        // this part runs every time the drop down is changed
       if($(this).val() == "CONT") // gets the selected value
         {
           //open sharepoint dialog using code below. 
         }
        else
         {
           //open sharepoint dialog using code below but change url parameter to https://www.gmail.com in your case. 
         }
    });
}

and open modal dialog with parameters like:

var options = {              
                url: 'https://www.google.com',
                tite: 'Google',
                allowMaximize: false,
                showClose: false,
                width: 800,
                height: 600,
};

              SP.UI.ModalDialog.showModalDialog(options);
  • will u send me clearly pls andrey – chiranjeevi Avala Jul 25 '14 at 11:57
  • Thinks andrey ungur I need to close this modal dialog and refresh the parent page through the server side script on button click in modal popup – chiranjeevi Avala Jul 28 '14 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.