retrive value from form

T

TJS

how do I determine what is being returned from form to prevent error
getting error of:

System.InvalidCastException: Specified cast is not valid.
Line 95: Dim custName As String =
CType(e.Item.Cells(3).Controls(0), TextBox).Text
 
A

Alvin Bruney

This means that the control being referred to at Cells[3] is not a text box.
Do a gettype on that control first, it will tell you what animal it is. You
probably are referring to the wrong cell.
 
T

TJS

there's 4 columns in the grid and the text box is column 4 (hence cell 3)

template has this as field type:

<EditItemTemplate>
<asp:TextBox runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.CustName") %>'></asp:TextBox>
</EditItemTemplate>
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top