FormView and inner control events

S

Stefano

Hi to all!
I'm using a FormView control heavily customized and I need to enable some
inner textboxes when the user write something in another inner textbox. So I
need to use inner controls events but ... they seem not to work!

I wrote something like that:

<asp:FormView ID="fv" runat="server" AllowPaging="True" DataKeyNames="id"
DataSourceID="dsMain" DefaultMode="Insert" Width="760px">
<EditItemTemplate>
.....
</EditItemTemplate>

<InsertItemTemplate>
.....
<asp:TextBox ID="s1a101TextBox" runat="server" Text='<%# Bind("s1a101") %>'
Width="500px" OnTextChanged="s1a101TextBox_TextChanged"></asp:TextBox>
.....
</InsertItemTemplate>
.....
</asp:FormView>


Partial Class _Default Inherits System.Web.UI.Page

Protected Sub s1a101TextBox_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim t1 As TextBox
t1 = fv.FindControl("s1a101TextBox")
If t1.Text = "hi!" Then
lblTest.Text = “OKâ€
Else
lblTest.Text = “NOâ€
End If
End Sub

End Class

but it absolutly doesn't work! I used breakpoints in the Sub and I saw that
the code is never executed.

Could you please help me? Thank you very much in advance.

Stefano
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top