Solved

onTextChanged event will not fire

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Footer for each row on Gridview 2 33
Convert Select to DropDownListFor MVC 5 2 30
Add a Condition in ASP Repeater 6 34
Why use this lambda? 12 37
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…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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