Dialog Framework in VS 2010

http://aarohblah.blogspot.com/2010/02/how-to-create-sample-dialog-using.html

Create new Sharepoint project, empty Sharepoint project, name DialogSample, .Net 3.5. Farm solution.

Add LAYOUT mapped folder.



A subfolder is generated in Layout:

Right click the subfolder and add a new Application Page, call AppPage.aspx.

Also, add an HTML page called MyDialog.htm.

1) ContentPlaceHolder=”PlaceHolderAdditionalPageHead” – such as CSS styles and in our case it will be JavaScript file. 
2) ContentPlaceHolder=”PlaceHolderMain” – allows us to write in the body area.  In our example we just add button.
3) ContentPlaceHolder=”PlaceHolderPageTitleInTitleArea” – allows us to write in title area.

<script type=”text/javascript”>
    function OpenDialog() {
        var options = SP.UI.$create_DialogOptions();
        options.url = “/_layouts/DialogDemo/MyDialog.htm”;

        options.width = 400;
        options.height = 300;
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        SP.UI.ModalDialog.showModalDialog(options);
    }

    function CloseCallback(result, target) {
        alert(“You called me!”);
    }
</script>

Advertisements
Post a comment or leave a trackback: Trackback URL.

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

%d bloggers like this: