Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Force a changed event from a child window ?

Reply
Thread Tools

Force a changed event from a child window ?

 
 
Adrian Parker
Guest
Posts: n/a
 
      08-20-2006
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


 
Reply With Quote
 
 
 
 
Luke Zhang [MSFT]
Guest
Posts: n/a
 
      08-21-2006
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.



 
Reply With Quote
 
 
 
 
Adrian Parker
Guest
Posts: n/a
 
      08-21-2006
excellent, works a treat.. thanks!

"Luke Zhang [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| 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.
|
|
|


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nike air force one, air force 1, air force one low cut, air force one abdul_razak@indiatimes.com Digital Photography 2 12-31-2008 04:29 PM
Nike Air Force Ones,Air Force One Air Force One-1 lky52193@gmail.com Computer Support 0 01-17-2008 04:40 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:46 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:34 PM
[HELP] Why the child window reopen a new child window ? bhchng ASP .Net 0 01-13-2004 07:17 AM



Advertisments