473,385 Members | 1,337 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,385 software developers and data experts.

Force a changed event from a child window ?

We have a date control (textbox) that opens up a popup calendar window, how,
when that calendar returns with the selected value can I cause the changed
event to fire on the date control ?

--
Adrian Parker
Ingenuity At Work Ltd
Aug 20 '06 #1
2 1716
Hello Adrian,

Regarding the issue, how did you open up a popup calendar window? Like
following?

<form id="form1" runat="server">

<asp:TextBox ID="TextBox1" runat="server" Height="29px"
Width="235px" onclick="window.open('calendar.aspx')"></asp:TextBox>
</form>

If you just implement as above, you may add following code in the
'calendar.aspx':

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged

Dim SelectedDate As String = Calendar1.SelectedDate.ToString()

Dim scriptString As String = "<script language=JavaScript>
window.opener.document.form1.TextBox1.value='" + SelectedDate + "';
window.opener.document.form1.TextBox1.fireEvent('o nchange');
window.close(); </script>"
ClientScript.RegisterClientScriptBlock(Type.GetTyp e("System.String"), "",
scriptString)

End Sub

Above script will set the value of the Text Box in its parent windown and
then fire the "onchange" event on the TextBox.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 21 '06 #2
excellent, works a treat.. thanks!

"Luke Zhang [MSFT]" <lu******@online.microsoft.comwrote in message
news:Xi**************@TK2MSFTNGXA01.phx.gbl...
| Hello Adrian,
|
| Regarding the issue, how did you open up a popup calendar window? Like
| following?
|
| <form id="form1" runat="server">
|
| <asp:TextBox ID="TextBox1" runat="server" Height="29px"
| Width="235px" onclick="window.open('calendar.aspx')"></asp:TextBox>
| </form>
|
| If you just implement as above, you may add following code in the
| 'calendar.aspx':
|
| Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
| e As System.EventArgs) Handles Calendar1.SelectionChanged
|
| Dim SelectedDate As String = Calendar1.SelectedDate.ToString()
|
| Dim scriptString As String = "<script language=JavaScript>
| window.opener.document.form1.TextBox1.value='" + SelectedDate + "';
| window.opener.document.form1.TextBox1.fireEvent('o nchange');
| window.close(); </script>"
|
|
| ClientScript.RegisterClientScriptBlock(Type.GetTyp e("System.String"), "",
| scriptString)
|
| End Sub
|
| Above script will set the value of the Text Box in its parent windown and
| then fire the "onchange" event on the TextBox.
|
| Sincerely,
|
| Luke Zhang
|
| Microsoft Online Community Support
| ==================================================
| Get notification to my posts through email? Please refer to
|
http://msdn.microsoft.com/subscripti...ult.aspx#notif
| ications.
|
| Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
| where an initial response from the community or a Microsoft Support
| Engineer within 1 business day is acceptable. Please note that each follow
| up response may take approximately 2 business days as the support
| professional working with you may need further investigation to reach the
| most efficient resolution. The offering is not appropriate for situations
| that require urgent, real-time or phone-based interactions or complex
| project analysis and dump analysis issues. Issues of this nature are best
| handled working with a dedicated Microsoft Support Engineer by contacting
| Microsoft Customer Support Services (CSS) at
| http://msdn.microsoft.com/subscripti...t/default.aspx.
| ==================================================
|
| This posting is provided "AS IS" with no warranties, and confers no
rights.
|
|
|
Aug 21 '06 #3

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

Similar topics

5
by: LuB | last post by:
I am programming in an event model - and I need to delete dynamically allocated memory. I apologize if this question is to Windows specific - but I think it has more to do with alloc and...
3
by: Phil | last post by:
how do I force a window, pened alone, to be displayed in its frame set? tried this: if (parent.location.href == self.location.href) { window.location.href = '../'; } the problem is that...
10
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
6
by: Daz | last post by:
Hello everyone, I would like to open a child window from the parent, and add an onload event listener to the child window which will tell the parent when the document has loaded. As far as I...
2
by: =?Utf-8?B?c29uaWNt?= | last post by:
Can anyone tell me how an MDI parent can fire an event that the child window can pick up? We have a MDI parent window containing 2 child windows (named 1 and 2). Child window 2 updates and fires...
1
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent...
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.