ModalDialog form unable to return value to webpart

M

Manpreet

Hi,

I have a web part page with a toolbar webpart and a grid webpart. In the toolbar, I have menu-items to update a field.

For selecting the value of the field I have another asp.net webform which shows the various options in a dropdownlist.
This form has to be a modal form and has to be shown on click the Toolbar menu items. When the user selects an option from the drop-down list and click OK then the option selected has to be
returned to the web-part page from where the webform was shown.

I'm able to do this when I have a Webform and not a sharepoint webpart page as the parent page. When I use a sharepoint web-part page, this doesn't work.

Code Snippet:

grid webpart(in a webpart page):

• Code-behind
void webpart_SetToolbarMenuItemProperties(object sender, SetMenuItemPropertiesEventArgs e)
{
switch (e.MenuItem.MenuItemAOTName.ToLower())
{
case "smmmileadchangestatuspostpone":
e.MenuItem.ClientOnClickScript = "UpdateStatusWindow()" ;
break;
}
}

• Html source


function UpdateStatusWindow()
{
var returnVal = window.showModalDialog('http://localhost/_layouts/ep/smmLea...ogWidth:200px;dialogHeight:120px;status:no');
alert (returnVal);


Aasp.net form shown as modal form

• Html source

<
input id="Button1" type="button" value=" OK " önClick="Close()" />


function Close()
{
window.returnValue = getSelectedReason();
window.close();
}
function getSelectedReason()
{
return form1.ddlUpdateStatus.value;
}


If anyone has some idea why this is not working, please provide your inputs.


Thanks,
Manpreet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top