473,778 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open window a new window and retrieve data from it. C#

Hi,

I have encounter a problem.Languag e use is C#. I would like to open a new
window (is a modal window, where I m not able to switch from parent window
after this window is open)from the parent window , where there are 3
dropdownlists and a "OK" button. Upon clicking the button, this window
will close and the select of the dropdownlists will be collect and send back
to the parent window. But I am do not know how to do it. Can somebody help.

Thanks
Cheryl
Nov 17 '05 #1
2 12570
Hi Cheryl,
you can achieve this by opening a model window through
some javascript in the main page, then calling a function
in the original page from the new window when the ok
button is clicked that processes the data from the modal
window.
The original page can process the modal form data using
javascript with the example below, but you can extend
this to process the data server side by forcing a
postback.

alex

Here's a code example:

[Modal Window - ModalWindow.asp x] [C#]
function ModalButtonClic k()
{
if( window.dialogAr guments )
window.dialogAr guments.Process ModalData
(dropdown1.valu e,dropdown2.val ue,dropdown3.va lue);
window.close();
}

<SELECT id='dropdown1'>
//additional dropdownlists rendered here
<INPUT type=button onclick='ModalB uttonClick();'
value='submit'>

[main page] [C#]
function ShowModalWindow ()
{
window.showModa lDialog
('ModalWindow.a spx',this,'dial ogWidth:400px;d ialogHeight:2
00px;center;hel p:no;Yes;resiza ble:yes;status: no;scroll:no'
);

}

function ProcessModalDat a(string1,strin g2,string3)
{
//javascript to do something with the form data
passed in here
}
-----Original Message-----
Hi,

I have encounter a problem.Languag e use is C#. I would like to open a newwindow (is a modal window, where I m not able to switch from parent windowafter this window is open)from the parent window , where there are 3dropdownlist s and a "OK" button. Upon clicking the button, this windowwill close and the select of the dropdownlists will be collect and send backto the parent window. But I am do not know how to do it. Can somebody help.
Thanks
Cheryl
.

Nov 17 '05 #2
Hi alex,

I am new in both javascript and asp.net. After putting in the code, I
have encountered this error msg, "Object doesn't support this property or
method"
on "window.dialogA rguments.Proces sModalData
(dropdown1.valu e,dropdown2.val ue,dropdown3.va lue);" . And does not know what
when wrong.

And I got another problem, after the form data have passed back to the main
page. How am I going to get the data and place it on the datagrid.
Thanks
Cheryl
"alex bowers" <al*********@du nnhumbyNSPM.com > wrote in message
news:0a******** *************** *****@phx.gbl.. .
Hi Cheryl,
you can achieve this by opening a model window through
some javascript in the main page, then calling a function
in the original page from the new window when the ok
button is clicked that processes the data from the modal
window.
The original page can process the modal form data using
javascript with the example below, but you can extend
this to process the data server side by forcing a
postback.

alex

Here's a code example:

[Modal Window - ModalWindow.asp x] [C#]
function ModalButtonClic k()
{
if( window.dialogAr guments )
window.dialogAr guments.Process ModalData
(dropdown1.valu e,dropdown2.val ue,dropdown3.va lue);
window.close();
}

<SELECT id='dropdown1'>
//additional dropdownlists rendered here
<INPUT type=button onclick='ModalB uttonClick();'
value='submit'>

[main page] [C#]
function ShowModalWindow ()
{
window.showModa lDialog
('ModalWindow.a spx',this,'dial ogWidth:400px;d ialogHeight:2
00px;center;hel p:no;Yes;resiza ble:yes;status: no;scroll:no'
);

}

function ProcessModalDat a(string1,strin g2,string3)
{
//javascript to do something with the form data
passed in here
}
-----Original Message-----
Hi,

I have encounter a problem.Languag e use is C#. I would

like to open a new
window (is a modal window, where I m not able to switch

from parent window
after this window is open)from the parent window , where

there are 3
dropdownlist s and a "OK" button. Upon clicking the

button, this window
will close and the select of the dropdownlists will be

collect and send back
to the parent window. But I am do not know how to do

it. Can somebody help.

Thanks
Cheryl
.

Nov 17 '05 #3

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

Similar topics

1
2444
by: Ed Brandmark | last post by:
I want to be able to open a window in the background of my page - without that flicker you see if you just open the window and then blur it (or focus the main window). The reason I want to do this is that I want to open a window and retrieve an URL. That URL may have 'nothing to say' and thus it will just do a self.close() In this case the user sees this flicker and then there is nothing back there. If something is returned the popup...
5
7091
by: Vanessa | last post by:
I have a question, is that any other way to retrieve data from another webpage besides using XML object? Because I am using XML object now but give me so much problems. If I used MSXML2.ServerXMLHTTP object, it gives me time out error: msxml3.dll error '80072ee2' The operation timed out If I used Microsoft.XMLHTTP object, it will hang IE!
5
10600
by: Ryan Hubbard | last post by:
Is it possible to get the recordset from an open query window? So you run the query. The window is open. Can vba retrieve this data?
1
3254
by: funcSter | last post by:
I want to retrieve data from an Excel file like how I would with a database. I understand that I would have to use OLE DB. Somehow I think I cannot get the connection string right, as the bit of code fails at "objConn.Open()" with the error: System.Data.OleDb.OleDbException: Could not find installable ISAM. Can somebody please help me out? I'm still a learning programmer, so if someone can point out my mistakes, it'll be great! Thanks! ...
2
2365
by: Jules_Anime | last post by:
Is it possible to create an onclick event which is attached to individual datalist items? I have a Datalist with some details on employees, and when you click on one we would like to open a new window which will be populated with some more data on this employee. The closest I have come is populating the DataList.Attributes.Add("onclick","sUrl") with some information but when I run the code it needs two clicks to open a window, and on...
5
2441
by: ggk517 | last post by:
We are trying to develop an Engineering application using PHP, Javascript with Informix as the back-end. Is it possible to retrieve data using Javascript but by accessing the Database. Say somebody enters part_no, than using Javascript is it possible to connect to the part master and retrieve the division and desc information? I am not allowed to use the PHP because this will require the user to insert the part number on the first...
3
2142
by: karthigaj | last post by:
Hi, Happy new Year... i need to retrieve the data from the web server which is developed using HTML and i need to process those data in c but i should not use any CGIs. Can anybody help me in this.
1
3030
by: hims | last post by:
hi i want to retrieve data from access through vb6.0 program but its not working. either sort out my error or help me with correct coding. thanks in advance !!!!!!! mail me at himanshu_s27@rediffmail.com my coding: Private Sub Command5_Click() Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset
0
1649
by: lenniekuah | last post by:
Hi Friends, I need your help. Please help me. I am trying to retrieve data from Excel Spreadsheet to fill the DataGridView for display prior to updating SQL SERVER with individual DataGridView row and encounter this error message: Public member 'WorkbookOpen' on type 'ApplicationClass' not found. which is caused by this coding trying to open the Excel WorkBook with the Excel name and Folder path. Dim objBook As Excel.Workbook =...
0
9629
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9470
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10127
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8957
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7475
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2865
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.