Solved

onTextChanged event will not fire

Posted on 2004-10-13
5
1,777 Views
Last Modified: 2010-05-18

Hi,

When the text changes, the event does not fire.
Public Sub txtNotes_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
          txtNotes.Attributes.Add("onTextChanged", "javascript:return confirm('Data has Changed. Click OK To Continue');")
End Sub

Your help is appreciated.
0
Comment
Question by:externet
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 12303057
Well you need to add this line in Page_load not inside txtNotes_TextChanged

--> txtNotes.Attributes.Add("onTextChanged", "javascript:return confirm('Data has Changed. Click OK To Continue');")
    'Add this line in Page_Load

-tushar
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 125 total points
ID: 12304557
Actually... there's no OnTextChanged event in JavaScript so you'll need to use 'OnBlur' or 'OnChange' event.

txtNotes.Attributes.Add("onBlur", "javascript:return confirm('Data has Changed. Click OK To Continue');")

or

txtNotes.Attributes.Add("onChange", "javascript:return confirm('Data has Changed. Click OK To Continue');")

& Remember you need to put this inside Page_Load event of the page

-tushar
0
 

Author Comment

by:externet
ID: 12305189
Excellent! -tushar!
here is my final answer and it works as expected.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txtNotes.Attributes.Add("onchange", "javascript:return confirm('Data has Changed. Click OK To Continue');")
End Sub

Thanks for a quick response.
externet.
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 12307210
Nice to have you going externet!

Thanks for A :)

-tushar
0
 

Author Comment

by:externet
ID: 12311682
Thank you  tusharashah.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now