.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Open sharpoint show Modal Dialog from server side on clientclick event

Posted By:Sagar Pardeshi       Posted Date: November 14, 2013    Points: 40    Category: SharePoint    URL: http://www.dotnetspark.com  

Open sharpoint Popup from server side on clientclick event add client click event on page load
 

<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); }
        }


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend