Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 21st, 2007, 06:35 PM
Registered User
Join Date: Jun 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ModalDialog form unable to return value to webpart


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()" ;

• Html source

<script type="text/javascript">
function UpdateStatusWindow()
var returnVal = window.showModalDialog('http://localhost/_layouts/ep/smmLeadReasonId.aspx','','dialogWidth:200px;dialog Height:120px;status:no');
alert (returnVal);

Aasp.net form shown as modal form

• Html source

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

<script type="text/javascript">
function Close()
window.returnValue = getSelectedReason();
function getSelectedReason()
return form1.ddlUpdateStatus.value;

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Modaldialog ratnamp ASP.NET 1.0 and 1.1 Professional 3 September 21st, 2007 03:26 AM
ModalDialog from server side moriayi ASP.NET 2.0 Basics 0 May 28th, 2007 04:50 AM
"Return parameters" on a form carlf01 BOOK: Expert One-on-One Access Application Development 0 March 2nd, 2007 07:35 PM
Form validation & conditional return confirmation GMiles1972 Javascript How-To 3 February 3rd, 2004 11:31 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.