Solved

onTextChanged event will not fire

Posted on 2004-10-13
5
1,773 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

21 Experts available now in Live!

Get 1:1 Help Now