SharePoint 2010: How to pass query string in SharePoint modal dialog

Scenario:

Usually we open the modal dialog like the following in client side code:

var option = { url:””, title:””, width:””, height:””, dialogReturnResultCallBack: closeFunction }

SP.UI.ModalDialog.showModalDialog(options);

By using this way to open the modal dialog, you won’t be able to pass in additional query string in the url\

Modal Dialog Reference

http://msdn.microsoft.com/en-us/library/ff410058(v=office.14).aspx

 

Solution:

We could use SP.UI.ModalDialog.OpenPopUpPage method

SP.UI.ModalDialog.OpenPopUpPage(url, callback, width, height);

By using this method we can pass in the query string by adding into the url,

for example: http://site/pages/default.aspx?q=1&text=2

Microsoft OpenPopUpPage  reference

http://msdn.microsoft.com/en-us/library/ff410825(v=office.14).aspx

Advertisements

2 thoughts on “SharePoint 2010: How to pass query string in SharePoint modal dialog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s