473,382 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

ModalDialog form unable to return value to webpart

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

May 22 '07 #1
0 1208

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Semi Head | last post by:
Hello folks, I'm looking for a script to validate a specific number value in a standard form input field. An example would be, if someone enters a number into a form input, I want the script to...
0
by: J. Jespersen | last post by:
Hi people, I fiddling with webparts, and have created my own custom webpart from scratch. The webpart itself is contained in a myPart.dll I have two different sites. SiteA and SiteB. Both are...
3
by: Jav | last post by:
I create a UserControl (.ascx), and then change it in code to: Inherits System.Web.UI.WebControls.WebParts.WebPart expecting that it will now be treated as a WebPart. But this immediately...
5
by: Rabia | last post by:
I am using the window.open() with modal=yes to simulate the pop up window as modalDialog in mozilla/firefox. The pop-up window (child) has a few options which the user selects and then click the...
6
by: praan | last post by:
I am trying to display xml content in a modaldialog window using window.showModalDialog(), but a blank modaldialog window is displayed. can anyone help me with this. Any other way present to...
0
by: Ken | last post by:
We have a shared hosting plan (Windows-based) with GoDaddy.com. GD.com has a "generic" form mailer script (gdform.asp) that allows us to set up a "Contact Us" page, which, when the user clicks...
0
by: Manpreet | last post by:
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...
0
gchq
by: gchq | last post by:
Hi there Is it possible to halt the execution of code to allow a ModalDialog window to open and return a value?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.