Understanding the formveiw ItemInserting Bug ASP.Net 2.0?

R

rogoflap

I don't quite under stand this event in a formview.

I am using this method in a formview. I have a bound text box. Say
UserName that has to be updated before the isert happens.

I have a formview set to an SQLDataSource with Update, Insert, Select,
Delete all inside the control.

I want to Insert a record using the Insert template.

During the Formview.Inserting event I have some code that calculates
the Username then tries to set the Username databound textbox to that
value.

Code is like the following:

dim tx as textbox
tx = formview1.row.findcontrol("txtUserName")
tx.text = sUserName

Now I stopped the code and verified that the sUserName had a value and
that tx.Text had a value, but after the insert happens this field is
blank in the database.

If I manually put in a value in the form then hit the Insert button, it
works fine.

What am I missing here?
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top