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: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


1 Answer 1


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. 
           //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,

  • will u send me clearly pls andrey Jul 25, 2014 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 Jul 28, 2014 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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