Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my custom SharePoint 2010 web part, I am allowing the user to specify his information in a model dialog window. I then need to use this information in my web part code behind for further processing.

But I am not pretty sure as how to read this information back in my managed code.

Appreciate any help on this.

share|improve this question

3 Answers 3

If your modal dialog was actually just a seperate

<div> 

tag in your web part which was shown/hidden by the SharePoint dialog framework then you can just treat the controls in the dialog as you would any other control.

There is further info on rendering a div as a dialog here:

http://www.endusersharepoint.com/EUSP2010/2010/05/27/client-side-ajax-applications-in-sharepoint-2010-%E2%80%93-part-5-modal-dialogs/

share|improve this answer
    
Thanks Charls for pointing me to that useful post, but I could not find the solution to my proble aka how to pass the values as computed by the ECMA model back to my managed code? –  Vivek Sep 30 '10 at 1:33
    
If you NEED the values in your code behind then you could have your javascript populate a hidden control which passes the values back to your code behind. There is probably a cleaner way using services or callbacks, but this keeps it simple. –  Charles Lee Sep 30 '10 at 15:35

Your modal dialogue could trigger a postback to the page and set the user-entered values put into the query string, which could be read by the web part.

share|improve this answer
    
Putting user entered data into the query string is not the securest method of transport, even in a cross page scenario. –  Charles Lee Sep 29 '10 at 21:29

You can return values from a modal dialog by the use of 'commonModalDialogClose()'.

Here you can find an example how to do so: http://www.itidea.nl/index.php/a-better-user-experience-with-the-dialog-framework-and-notifications/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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