Open SharPoint Show Modal Dialog from Server Side on Clientclick Event

Posted: November 7, 2014 in SharePoint2010, SharePoint2013

In this bog we will discuss opening the SharePoint and showing the Modal Dialog from the server side on the clientclick event.

<asp:imagebutton id=”imagebtnTestDemo” runat=”server” imageurl=”~/_layouts/images/settings.png”ToolTip=”SP.UI.ModalDialog.showModalDialog” TabIndex=”4″ />

 

protected void Page_Load(object sender, EventArgs e)

{

try

{

string Url = “/_layouts/TestDialogPage.aspx&Source=/SitePages/Test.aspx”;

imagebtnTestDemo.OnClientClick = “javascript:” +

” var options = {” +

” url: ‘” + Url + “‘,” +

” title: ‘DialogPage’,” +

” allowMaximize: true,” +

” showClose: true,” +

” width: 800,” +

” height: 600″ +

” };” +

“SP.UI.ModalDialog.showModalDialog(options);”;

}

catch (Exception ex) { HandleException(ex); }

}

Advertisements

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