ASP.Net Textbox problem ?

L

Luqman

I have coded in Textbox_changed Event:

If CType(txtVoucherNo.Text, Long) = 0 Then

Me.DetailsView1.ChangeMode(DetailsViewMode.Insert)

Me.DetailsView1.AutoGenerateInsertButton = True

Me.DetailsView1.AutoGenerateEditButton = True

Exit Sub

End If



When page is loaded 1st time, and I type 0 (Zero) in Textbox and press
Enter, DetailView changes its mode to Insert Mode, which I require, however
if I press Cancel on DetailView without entering anything and then click on
textbox and press Enter again after typing 0 (Zero), nothing happens, any
idea please ?

It seems that DetailView Cancel Button has added some extra character in the
Textbox which is not visible to me.

Best Regards,

Luqman
 
G

Guest

Why not set a breakpoint on the TextChanged event and see if the event is
even being fired? If the value of the textbox where being changed, you could
find out at the breakpoint also.
 
L

luqman

yes, the event was firing but 2nd time it did not find the value "0" in
textbox, it was "0" + Enter, so on ModeChanging Event of DetailView Control,
I set the textbox.text="" and it worked out.

Best Regards,

Luqman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top