473,699 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return Values from Popup to UserControl

Hi,

Can anyone tell me please how can I return values from a popup to a
UserControl. I use the same "method" like to return to a WebForm, but it not
works in UserControl case.
I have this code to return from popup to webform:
------------------------------------------------------------------------
sbScript.Append ("<script language='javas cript'>")
sbScript.Append (Environment.Ne wLine)
sbScript.Append ("window.opener .document.forms[0].elements['")
sbScript.Append (Request.QueryS tring("srcA"))
sbScript.Append ("'].value = '")
sbScript.Append (strYear)
sbScript.Append ("';")

sbScript.Append (Environment.Ne wLine)
sbScript.Append ("window.opener .document.forms[0].elements['")
sbScript.Append (Request.QueryS tring("srcM"))
sbScript.Append ("'].value = '")
sbScript.Append (strMonth)
sbScript.Append ("';")

sbScript.Append (Environment.Ne wLine)
sbScript.Append ("window.opener .document.forms[0].elements['")
sbScript.Append (Request.QueryS tring("srcD"))
sbScript.Append ("'].value = '")
sbScript.Append (strDay)
sbScript.Append ("';")

sbScript.Append (Environment.Ne wLine)
sbScript.Append ("window.close( );")
sbScript.Append (Environment.Ne wLine)
sbScript.Append ("</script>")
RegisterStartup Script("CloseDa te", sbScript.ToStri ng())
------------------------------------------------------------------------
--
Programming ASP.NET with VB.NET

Thank's (if you try to help me)
Hope can help (if I try to help)

ruca
Dec 14 '06 #1
2 2377
Hi,

ruca wrote:
Hi,

Can anyone tell me please how can I return values from a popup to a
UserControl. I use the same "method" like to return to a WebForm, but it not
works in UserControl case.
Usually, when something works for a Page but not for a Control, it's an
ID problem. Be aware that when a control gets added to the page, all its
children controls get a different ID from the one set using the ID
attribute. This is to guarantee that all the IDs on the page are unique.

Inspect your produced HTML code using view-source. The control's unique
ID can be obtained on the server using myControl.Clien tID.
I have this code to return from popup to webform:
------------------------------------------------------------------------
sbScript.Append ("<script language='javas cript'>")
Deprecated. Use

<script type="text/javascript">

instead.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Dec 14 '06 #2
Hi,

But this control is used in many pages
How can I specifief or pass the ID into my UserControl, since is this that
opens my popup????

--
Programming ASP.NET with VB.NET

Thank's (if you try to help me)
Hope can help (if I try to help)

ruca

"Laurent Bugnion" <ga*********@bl uewin.chescreve u na mensagem
news:uo******** ******@TK2MSFTN GP03.phx.gbl...
Hi,

ruca wrote:
>Hi,

Can anyone tell me please how can I return values from a popup to a
UserControl. I use the same "method" like to return to a WebForm, but it
not works in UserControl case.

Usually, when something works for a Page but not for a Control, it's an ID
problem. Be aware that when a control gets added to the page, all its
children controls get a different ID from the one set using the ID
attribute. This is to guarantee that all the IDs on the page are unique.

Inspect your produced HTML code using view-source. The control's unique ID
can be obtained on the server using myControl.Clien tID.
>I have this code to return from popup to webform:
------------------------------------------------------------------------
sbScript.Appen d("<script language='javas cript'>")

Deprecated. Use

<script type="text/javascript">

instead.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Dec 14 '06 #3

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

Similar topics

4
1628
by: Nicholas Then | last post by:
I have a usercontrol that contains a datagrid. This grid lists information from my database. No big deal...this works fine, and when the user selects an item I have a popup window appear with the data that the user can edit. Now when they click submit on the popup window to save their changes, can I get the datagrid in the usercontrol on the parent page to reload. I have been trying to do this for about a year not and I have never...
0
1016
by: Rabeek Ahamed | last post by:
I am calling a popup window from the main page. That popup has to return list of values in an array. How can i return arrays to main page from pop up? And I want to list those array of values into a grid. Can you please give me the list of code? Advance thanks for your reply. regards,
1
5404
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for that), the popup window will have also a text box and a button. when the User click on the button the value on the textbox will be send back to the textbox on My_WUC. I hope I was clear off what I want to do. I've been searching for some ideas...
1
2215
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to be used on a number of different ASPX pages (that's why I made it a ASCX). When clicking the image button, I run simple JavaScript to open another popup ASPX page that contains a calendar control and two dropdownboxes for the time (hours :...
2
2306
by: Simon Verona | last post by:
I have a problem, best explained by example. I have a usercontrol which contains a text box and a button. If the button is clicked then the calender control is displayed as a "popup" so that a date can be chosen. This replicates the date-picker control except that it has other checks in it (my user control also has the ability for other data types with other "popups" for validation).... The problem is that if the user control is at...
3
2293
by: Kevin Attard | last post by:
Hi, Is there a way to return a value from a control inside a popup and assign it to a control inside the parent form? Thanks, kev
2
1665
by: ruca | last post by:
Hi, Can anyone tell me please how can I return values from a popup to a UserControl. I use the same "method" like to return to a WebForm, but it not works in UserControl case. I have this code to return from popup to webform: ------------------------------------------------------------------------ sbScript.Append("<script language='javascript'>")
9
1839
by: Academia | last post by:
ContextMenu has a Popup event but MainMenu does not. I need Popup with MainMenu. Do you know anyway to simulate it? Thanks in advance
1
2012
by: perhapscwk | last post by:
I use below to popup a page "popup" and then pass the value from popup and back to my page. see below However, how to return 2 values? I can return 1 value only. function openModal() { retVal=showModalDialog('popup.htm'); valReturned=retVal; alert('The following text has been returned: "'+valReturned+'"'); }
0
8615
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
9173
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
9033
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...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7748
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...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.