Solved

onTextChanged event will not fire

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

805 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